Some methods of arrays

Iteration of arrays can be done via use of a map function instead of using for loops. Given an array, each element of the array is operated upon. Function creates a new array instead of updating the existing one. // Multiply each element of oldArray with 3 to create a newArray var newArray = oldArray.map(function(val) … Read More

Objects in JS

Objects in JS can be created by: Use of variables Use of functions // table variable | // use of function var table = { | var table = function() { “legs”:4, | this.legs = 4; “color”:”brown”, | this.color = “brown”; “material”:”wood” | this.material = “wood”; }; | }; An instance of these objects can … Read More

Hour 2 : JS

Continuing learned using boolean values, conditional statements, switch case and use of functions. Everything goes on like we might have learned in some other language. Encountered only a new operator category called the strict equality operator and strict inequality operator. Strict equality operator uses === instead of the normal == for the equality operator. So … Read More
Follow

Get notified with the latest posts

Plugin Supporter WordPress Post Navigation
%d bloggers like this: