Is it possible to actually write a function so I could always use it like this:
const arr = [1, 3, 3, 5];
arr.count(3) //should return 2
or even
[1, 3, 3, 5].count(3);
If so, what do I have to study to achieve that?
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
Is it possible to actually write a function so I could always use it like this:
const arr = [1, 3, 3, 5];
arr.count(3) //should return 2
or even
[1, 3, 3, 5].count(3);
If so, what do I have to study to achieve that?