Javascripting.
A.R.M | Are | Cool |
---|---|---|
The Gromble | right-aligned | $1600 |
Krumm | centered | $12 |
Ickis | are neat | $1 |
There must be at least 3 dashes separating each header cell.
The outer pipes (|) are optional, and you don't need to make the
raw Markdown line up prettily. You can also use inline Markdown.
Markdown | Less | Pretty |
---|---|---|
Still | renders |
nicely |
1 | 2 | 3 |
Variables #
Primitives............. Compound Data
ex: 5, true, abdc ..... Arrays [] & Objects {}
let & const are used to declare variables
use LET, If you plan to change it later
useCONST otherwise
Arrays (lists).............. Objects (dictionaries)
const arr = [1,2,3] ........ const obj = {name:"Steve", age: 33}
EXAMPLE............. console.log(obj.name);
Steve
for in loop to interate over an object
EXAMPLE 2...........for (let key in obj) {console.log(key, obj[key]);};
Name Steven age 33
for of loop to interate over an array
EXAMPLE 3..........for (let num of nums) {console.log(num);}output would be..... 1 2 3
FUNCTION is any code you want to use more than once.
EXAMPLE............ function NAMEofFUNCTION (paramater1NAME,paramater2NAME) {return paramater1NAME + paramater2NAME}
output would be..... NAMEofFUNCTION(paramater1NAME,paramater2NAME)
A method is a function that is associated with an object.
← Home and camone mofos