You must do TWO THINGS:
- Code along with the examples. [ YOU MUST RITE TEH CODES ☠️ ]
- 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.
- Number
- Function
- String
- Boolean
- Array
- Object
let a = 3;
let b = 1.5;
let c = a + b;
console.log(c); // 4.5
Now make your own example. Do it now. Try to break things.
let add = (a, b) => {
return a + b;
};
let sum = add(3, 1.5);
console.log(sum); // 4.5
Now run your own example. Right MEOW! Make mistakes.
let greeting = 'Hello';
let name = 'Charlie';
let message = greeting + ' ' + name;
console.log(message); // Hello Charlie
Now run your own example. Immediately! Do bad things.
let feet = 2;
let isHuman = feet < 3;
if (isHuman) {
console.log('Hi!');
}
Now run your own example. Without delay! Write the ugliest code.
let alphabet = ['a', 'b', 'c'];
for (let letter of alphabet) {
console.log(letter); // a b c
}
Now run your own example. Quickly! Make errors happen.
let dictionary = {
'you': 'toi',
'me': 'moi',
'him': 'lui',
'her': 'elle'
};
let word = dictionary['you'];
console.log(word); // toi
Now run your own example. Quickly, before ze Germans get here. The code must become a neurological extension of your body.