Flashcards
web
Cards in this deck (14)
- 13 ways to declare function and what they're calledfunction doSomething() { }
anon:
doSomething = function() { }
arrow:
doSomething => { } - 25 scoping vs 6 scopingglobal, function
vs
global, function, block - 3creating an array vs assigning a valueargay = [ ];
vs
argay[4] = "gay"; - 4push vs lengthsends shit to end of array
vs
returns the length of the array - 5sort vs reverse sortidentifier.sort()
vs
identifier.reverse() - 6pop vs shiftremoves last element of the array
vs
removes first element of the array - 7unshift + exampleadds to the start of the array
identifier.unshift("james"); - 8splice and all 3 argumentsswitches items out of the array.
1st argument is position in array second is amnt of elements to remove third is adding an element - 9for each and examplecalls a function for each argument in the array.
identifier.foreach(function(){ } ); - 10methods deffunctions of a class that are meant to create and/or initialize and object
- 11primitive vs reference variablesstores a literal value at the address
vs
stores a reference to a variable or set of variables at the address(these can be changed) - 12time functions and eggsplane return valuegetDay()
getYear()
getMonth()
getHours() - 13math functions ""Math.pi
Math.pow(2,3)
Math.min()
Math.max()
Math.sqrt(81)
Math.round()
Math.ceil()
Math.floor()
Math.random() - 14string functions ""value.length
value.charAt(6)
value.indexOf("john")
value.toUpperCase()
value.toLowerCase()
Information
- Description
- Flashcards on web, created by hasdfhfsd gsdhhgsdh on 06/02/2019.
- Created by
- hasdfhfsd gsdhhgsdh
- Views
- 0
- Rating