Skip to content

Instantly share code, notes, and snippets.

View Mohamed-Code-309's full-sized avatar
🎯
Focusing

Mohamed Jebril Mohamed-Code-309

🎯
Focusing
View GitHub Profile
@Mohamed-Code-309
Mohamed-Code-309 / JS_Array_New_Method_1.md
Last active March 11, 2023 11:26
JavaScript : New Array Methods

Create New Array Methods in JavaScript

We are going to add new methods to the Array() object using Array.prototype property.

Prototype is a property that is associated with every function and object by default in JavaScript.

With Array.prototype we can access existing methods in the Array() object like push(), pop(), map() etc. or add new methods that will be available to every array we define.

limit βœ‹

extract a specific number of elements from an array starting from first element.