Javascript – Common methods for Build-in classes

Javascript – Common methods for Build-in classes

Date Array You can also define an array var a = new Array(); or with initial values: var a = new Array(11, 22, 33, 44); if you put only one argument then you specify the length of the array: push(element) – add a new array element at the end pop() – deletes the last element join(char) – joins all the elements of an array with the character you specify and return it as a string splice(start, end) – removes elements splice(start, howMany to removed, newElement, newElement…) – you can replace…

Javascript – Common methods for Build-in classes Read More

Javascript – Classes

Javascript – Classes

Javascript introduced classes in ES6 (ECMAScript2015). To define a class you need to use the class keyword and add a constructor method which is executed when a new object is created. You must declare a class before you use it. You can create new objects from this class using the new keyword In classes, the functions are defined only with their name, without the function keyword Static methods Static methods are created using the static keyword. They can be used without an object creation. You do not need to create…

Javascript – Classes Read More