Skip to content

Latest commit

 

History

History
125 lines (78 loc) · 1.97 KB

quick-intro.md

File metadata and controls

125 lines (78 loc) · 1.97 KB

Quick Intro

You must do TWO THINGS:

  1. Code along with the examples. [ YOU MUST RITE TEH CODES ☠️ ]
  2. Complete these exercises as you become able.

Before coding can become intellectual, it must become physical. You can only learn the code intuitively, to try to understand is to fail. To learn the patterns by trying things again and again is to succeed.

Data types

  • Number
  • Function
  • String
  • Boolean
  • Array
  • Object

Number

let a = 3;

let b = 1.5;

let c = a + b;

console.log(c); // 4.5

numbers

Now make your own example. Do it now. Try to break things.


Function

let add = (a, b) => {
  return a + b;
};

let sum = add(3, 1.5);

console.log(sum); // 4.5

functions

Now run your own example. Right MEOW! Make mistakes.


String

let greeting = 'Hello';

let name = 'Charlie';

let message = greeting + ' ' + name;

console.log(message); // Hello Charlie

strings

Now run your own example. Immediately! Do bad things.


Boolean

let feet = 2;

let isHuman = feet < 3;

if (isHuman) {
  console.log('Hi!');
}

booleans

Now run your own example. Without delay! Write the ugliest code.


Array

let alphabet = ['a', 'b', 'c'];

for (let letter of alphabet) {
  console.log(letter); // a b c
}

arrays

Now run your own example. Quickly! Make errors happen.


Object

let dictionary = {
  'you': 'toi',
  'me': 'moi',
  'him': 'lui',
  'her': 'elle'
};

let word = dictionary['you'];

console.log(word); // toi

objects

Now run your own example. Quickly, before ze Germans get here. The code must become a neurological extension of your body.

fingers