![]() The forEach() method in the example above invokes the capitalize() function. Note: Since every item in the array stands for a word, we changed the name of the item parameter to “ word”. const words = Ĭonst capWords = words.forEach(capitalize) Īrr = word.toUpperCase() + word.substring(1) Read more about this here.īelow is some sample code that uses forEach() to iterate through a list.
0 Comments
Leave a Reply. |