tostring, join, pop, push,shift,unshift, delete,concate,sort,splice,slice,reverse,isarray,indexof,lastindexof,find, findindex,includes, entries,every,some,fil, copywithin,valueof,foreach,map,filter,reduce,reduceright,from
p
18 JavaScript functions (widely used): 1. console.log(...args) ➝ Outputs messages or objects to the console for debugging purposes. 2. setTimeout(callback, delay) ➝ Executes a function after a specified delay in milliseconds. 3. setInterval(callback, interval) ➝ Repeatedly executes a function at specified intervals. 4. querySelectorAll(selector) ➝ Returns a NodeList containing all the elements that match the specified selector. 5. addEventListener(event, callback) ➝ Attaches an event handler function to an HTML element. 6. JSON.parse(jsonString) ➝ Parses a JSON string and returns a JavaScript object. 7. JSON.stringify(object) ➝ Converts a JavaScript object into a JSON string. 8. forEach(callback) ➝ Executes a provided function once for each array element. 9. map(callback) ➝ Creates a new array with the results of calling a provided function on every element. 10. filter(callback) ➝ Creates a new array with elements that satisfy a provided condition. 11. reduce(callback, initialValue) ➝ Reduces an array to a single value by applying a function for each element. 12. slice(start, end) ➝ Returns a shallow copy of a portion of an array between specified start and end indices. 13. splice(start, deleteCount, ...items) ➝ Changes the array content by removing/replacing elements and/or adding new elements. 14. indexOf(element) ➝ Returns the first index at which a given element can be found in the array, or -1 if not present. 15. includes(element) ➝ Determines whether an array includes a certain element, returning true or false. 16. sort(compareFunction) ➝ Sorts the elements of an array based on the provided function or default sorting order. 17. reverse() ➝ Reverses the order of the elements in an array. 18. isArray(value) ➝ Checks if a given value is an array, returning true or false.
No comments:
Post a Comment