Giter Club home page Giter Club logo

js-novice-ninja's Introduction

JS-Novice-Ninja-2nd-edition

Reserved words
abstract else instanceof super
boolean enum int switch
break export interface synchronized
byte extends let this
case false long throw
catch final native throws
char finally new transient
class float null true
const for package try
continue function private typeof
debugger goto protected var
default if public void
delete implements return volatile
do import short while
double in static with

should be reserved undefined, NaN, Infinity

primitive data types
String Boolean
Symbol Undefined
Number Null

typeof "hello" → "string"

typeof 10 → "number"

typeof true → "boolean"

typeof { name : 'John' } → "object"

typeof [ 1, 2, 3 ] → "object"

Template Literals super-powered strings

She said, "It's Me!"

const name = Siri; >> Hello ${ name }!; → 'Hello Siri!'

const uniqueID = Symbol('this is a uniqueID');

typeof uniqueID → "symbol"

Only 9 values are always false and these are known as falsy values:

  • "" // double quoted empty string literal
  • '' // single quoted empty string literal
  • `` // empty template literal
  • 0
  • -0 // considered different to 0 by JavaScript!
  • NaN
  • false
  • null
  • undefined

Boolean(0); → false

!!(0) → false

https://www.sitepoint.com/quick-tip-create-manipulate-arrays-in-javascript/

const letters = new Set('Hello');

letters → Set(4) [ "H", "e", "l", "o" ]

const words = new Set().add('the').add('quick').add('white').add('fox');

words → Set(4) [ "the", "quick", "white", "fox" ]

const arrays = new Set().add([1]).add([1]);

arrays → Set [ (1) […], (1) […] ]

Set(2) size: 2 entries: 0: Array [ … ] 1: Array [ … ]

const mixedTypes = new Set().add(2).add('2');

mixedTypes → Set [ 2, "2" ]

mixedTypes.size → 2

mixedTypes.has('2'); → true​

mixedTypes.delete('2') → true​

mixedTypes → Set [ 2 ]

mixedTypes.clear()

mixedTypes → Set []

spread operator with Set

const messagesShop = new Set().add('carrots').add('broccoli').add('rice');

const messagesArray = [...messagesShop];

messagesArray → Array(3) [ "carrots", "broccoli", "rice" ];

var fruits = ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango'];

var citrus = fruits.slice(1, 3);

citrus → Array [ "Orange", "Lemon" ]

The keyword this refers to the object that it is within.

DOM

const body = document.body

typeof body => "object"

body.nodeType; 1

document.querySelector('#bats');

  • document.querySelectorAll('.hero'); NodeList(3) [ li.hero, li#bats.vigilante.hero, li.hero ]

    Quiz

    js-novice-ninja quiz

    Set-up

    Node v7.10.0

    Node.js - REPL Terminal

    links

    developer mozilla Map

    developer mozilla Object

    developer mozilla Map values

    hackernoon es6 maps

    Interface HTMLCollection

    The DOM also specifies a NodeList interface

    js-novice-ninja's People

    Watchers

     avatar  avatar  avatar

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.