I'm learning the basics of java for a few weeks and it's all fun! Did many micro-apps with it and overall, having a good time.
But while I was writing some code for my course, i was stuck at one part.
The app is about search bars using functions and arrays
const Characters = [{name: 'Mickey Mouse', age: 93},{name: 'Winnie The Pooh', age: 96},{name: 'Donald Duck', age: 86},{name: 'Scrooge McDuck', age: 75}]
const searcbar = function(Charac, name){
const searchalt = Charac.find(function(Naame, index){
return Naame.name.toLowerCase() === name.toLowerCase()
})
return searchalt
}
let data = searcbar(Characters, 'winnie the pooh')
console.log(data);
I nearly understood how the whole code works other than this part:
const searchalt = Charac.find(function(Naame, index){
return Naame.name.toLowerCase() === name.toLowerCase()
Where does this function get its data from? Like I didn't give it any value, I cant understand where does it get from.
Thank you.