JavaScript Array every()

The JavaScript array every() method is used to determine whether all the elements of an array are satisfying the provided function conditions. Syntax: array.every (callback (currentValue, index, arr), thisArg) Parameters: callback: It represents the method to test the condition. It is required. currentValue: It represents the array’s current element. It is required. index: Current element … Read more

JavaScript Array copyWithin()

The JavaScript array copyWithin() method is used to copy the part of the given array with its own elements and returns the modified array. Syntax: array.copyWithin (target, start, end) Parameters: target: It represents the index position where the elements will copied. It is Required. start: It represents the index position to start copying elements. The … Read more

JavaScript Array concat() Method

The JavaScript array concat() method is used to return a new array object that contains two or more merged arrays. Syntax: array.concat (array1,array2,….) Example: <!DOCTYPE html> <html> <head> </head> <body> <script> var a1=[“GOLD”,”SILVER”,”DIAMOND”]; var a2=[“RUBY”,”PLATINUM”]; var a3=[“BRONZE”]; var sum=a1.concat(a2,a3); document.writeln(sum); </script> </body> </html>

JavaScript WeakMap

JavaScript WeakMap object is used to store the elements as key-value pairs where keys are weakly referenced. Syntax: new WeakMap([iterable]) Where: iterable is the object whose elements are in the form of a key-value pair. Note: WeakMap object can not contain the primitive type elements. It can contain only object-type elements. JavaScript WeakMap Methods: delete() … Read more

JavaScript Map

JavaScript map object is used to store the elements as key-value pair. All the operation like search, add, update, delete are done using key. Syntax: new Map([iterable]) Parameters: iterable: It represents the object whose elements are in the form of key-value pair. Note: Map object can not contain the duplicate keys but can contain duplicate … Read more

JavaScript Set

To store the elements with unique primitive values or object references, a javascript set object is used. Syntax: new Set([iterable]) Where: iterable is the object whose elements will be added to the new Set. Note: JavaScript set cannot contain duplicate elements i.e. it keeps unique elements only. JavaScript Set Methods: add() Use: To add the … Read more