Topics: The .forEach() Method , The .map() Method , The .filter() Method , The .findIndex() Method , The .reduce() Method , Iterator Documentation , Choose the Right Iterator
Project Title: Good Mood Actions
Create a html file with your name like john.html
Add current code to that file:
<!DOCTYPE html> <html> <body> <script> // your code here </script> </body> </html>
- Create array
actionsof actions for good moods includes:
- rest and refresh
- connect with others
- take time to enjoy
- share interests
- contribute to community
- take care of yourself
- challenge yourself
- reduce your stress
- notice the here and now
- ask for help
Log them into console with for loop.
Log them into console with .forEach() Method.
Log them as ordered list into console with composing .map() and .forEach().
Filter items that start with
ccharachter and then as ordered list log them into console with composing .filter(), .map() and .forEach().
actionsLettersthat holds number of letters in each item of the array (Note: do not count spaces).
Do the sum of letters of all items in the array. Use .reduce() on the array of previous step.
Find first item of
actionsLettersthat has less than 10 letters. Use .findIndex
Want to get reviewed?
Send Pull Request. Check how to deliver your code: https://codingwithbasir.com/how-to-deliver-projects/