Please enable JavaScript.
Coggle requires JavaScript to display documents.
JS - Objects and Arrays (Math Object (function:max, min, sqrt, used as a…
JS - Objects and Arrays
Data sets
-
The first index of array is zero, not one
Properties
-
-
-
Square brackets [ ]: The expression is evaluated to get the property name and uses the result as the property name.
-
Object
Values of the type object are arbitrary collections of properties, and we can add or remove these properties as we please.
-
-
there is a difference between having two references to the same object and having two different objects that contain the same properties.
Object as map
One ways is to store all the correlation in an array, using objects with name and value properties. But have to loop over to find the object with the right name
-
A map is a way to go from values in one domain to corresponding values in another domain.
for (var event in map)
-
Array methods
-
-
-
-
concat:used to glue arrays together,
Values of type string, number, and Boolean is not objects
-
Argument object
special variables named argument refer to an object that holds all of the arguments passed to the fuction
has a length property for each arguments, named 0, 1,2 and so on. It's a lot like an array but don't have any array method.
Using the flexible of passing arguments to create the function that don' t care about how many arguments passed
-
-