ECMAScrpit 6 - Object
Object
The Object
constructor creates an object wrapper. Methods of the Object constructor
Object.assign() -Object.assign(target, ...sources)
Copies the values of all enumerable own properties from one or more source objects to a target object.
The
Object.assign()
method only copies enumerable and own properties from a source object to a target object.
Object.keys() - Object.keys(obj)
The
Object.keys()
method returns an array of a given object's own propertynames
, in the same order as we get with a normal loop.
Object.values() - Object.values(obj)
The Object.values() method returns an array of a given object's own enumerable property values, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
Object.is() - Object.is(value1, value2)
Object.is()
determines whether two values are the same value.
Number& Math
The Number JavaScript object is a wrapper object allowing you to work with numerical values. A Number object is created using the Number() constructor. A primitive type object number created using the Number() function.
Number.isNaN()
Determine whether the passed value is NaN.
Number.isFinite()
Determine whether the passed value is a finite number.
Number.isInteger()
Determine whether the passed value is an integer
Number.isSafeInteger()
Determine whether the passed value is a safe integer
Number.parseFloat()
The value is the same as parseFloat() of the global object.
Number.parseInt()
The value is the same as parseInt() of the global object.
String&RegExp
The String
global object is a constructor for strings or a sequence of characters.
String.prototype.trim()
Trims whitespace from the beginning and end of the string. Part of the ECMAScript 5 standard.
String.prototype.substring()
The substring() method returns the part of the string between the start and end indexes, or to the end of the string.
String.prototype.slice()
The zero-based index at which to begin extraction
The slice() method extracts a section of a string and returns it as a new string, without modifying the original string.
Array
The JavaScript Array
object is a global object that is used in the construction of arrays; which are high-level, list-like objects.
[element0, element1, ..., elementN]
new Array(element0, element1[, ...[, elementN]])
new Array(arrayLength)