Functional Programming - Use the reduce Method to Analyze Data

Tell us what’s happening:
This may seem like a silly question, but I need to understand everything or at least attempt to.

I keep seeing Array.prototype. “some method” … or simply … the method… worded like this in the lesson.

here is an example >> Array.prototype.reduce() , or simply reduce()

What is the reason for stating this is a prototype? and then saying “or simply” the method?
Thank You again for the help guys!

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Functional Programming - Use the reduce Method to Analyze Data

Link to the challenge:

They are built in function of array type object.

Sooner, they will come in handy when you use them like :

array.reduce()
array.map()
array.filter()
array.join()

List of those built-in function, you could read more here. JavaScript Array Reference

so it is just reiterating that it is a certain type of Object? an array type object?

It’s saying that this method is defined on every array, but only on arrays.

Thank You Sir,
I might post my code on this reduce challenge so we can tear it up and start over, lol

The Object Oriented Programming section had you implement prototype methods and the Implement the filter Method on a Prototype also had you write your own Array.prototype method.

So it shouldn’t be totally unfamiliar at this stage.

Oh it’s not unfamiliar; it’s just a tool I haven’t used in a practical day to day setting.

the difference between an Object and a prototype, if I’m correct, is the prototype is created as soon as you change the Data??, … this behavior is by default.

but I’m not sure why they are both mentioned separately … what is the lesson trying to teach me buy mentioning both.

I’m looking for a deeper understanding of the lesson. That’s all.
Thank You.

No. I’m not sure exactly what you mean, but that’s not what a prototype is.

This lesson is not about objects. This lesson is about arrays. Specifically, this lesson is about one built in array method.

The phrase ‘array type object’ is confusing you since you are ignoring the word ‘array’ and only seeing the word ‘object’. Focus on the word ‘array’ if you only focus on one word.

Technically everything that’s not a primative data type in JavaScript is an object, but calling everything an object is confusing. Don’t do that.

We have an array here. That array has built in methods. Those built in methods are defined as part of the prototype of an array. The prototype says what every single array has.

This right here is the ‘big picture’ of what the prototype does.

1 Like

Thank You again Jeremy.

I had to read what a prototype is. A model based on something, to test against…

kind of like a rough sketch…

starting to internalize what you mean…

Ehh, this isn’t really the definition you are looking for here.

Very well,
Thank You

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.