kenvantruong
6/3/2018 - 3:19 AM

Type Variables

// strings
    'this is my string';
    'my second string';
    "my name is chris";

    // numbers
    10;
    500;
    3.14;

    // booleans (truthy / falsy)
    true;
    false;
    
    // specials
    undefined;
    null;
    NaN;

    // objects
    const user = {
      name: 'Chris',
      username: 'chrisoncode' 
    };

    // arrays 
    const users = ['chris', 'nick', 'holly'];
    const luckyNumbers = [1, 43, 54, 132];
    const whatever = ['chris', 1, 'holly'];
    
    const superUsers = [
      { name: 'chris' },
      { name: 'nick' },
      { name: 'holly' }
    ];

    console.log(superUsers[2].name);

    // declaring variables
    var thing        = 'first';

    const otherThing = {
      name: 'chris'  
    };
    let newThing     = 'third';

    otherThing.name = 'holly';

    // ======================
    let myVariable;


    myVariable = 'something';