JavaScript for Beginners #42 Coding Challenge 6
GreeneMath.com
0:00 / 0:00
JavaScript for Beginners #42 Coding Challenge 6
1 190 просмотров · 5 лет назад
GreeneMath.com
194 тыс. подписчиков
1 190 просмотров · 5 лет назад
Here, we will have a coding challenge that focuses on what we have learned with functions and loops.
0:00 Laying out the coding challenge
2:03 Creating our function
2:38 Creating a for loop
3:40 Setting up our console.log()
6:10 Fixing our ending for 3rd, 2nd, and 1st places
8:00 Adding in a 1st place emoji
9:10 Fixing our application to return a string
10:30 Using \n to create new lines in our application
11:15 Adding additional people to our array
//Create a function that takes in a multi-dimmensional array of the participants in a weight lifting contest, along with the total amount lifted.
//The function should print the name of the person, the amounts they lifted, and their place in the contest. The order should go backwards and give a trophy to the first place person.
//Modify the array to have more people and show that it still works. Let's use a max of 10 participants.
const malelifters = [["Jamie", 1050], ["Mark", 1020], ["Steven", 990], ["Max", 980], ["Gerald", 970], ["Brad", 955], ["Alex", 920]];
const femalelifters = [["Jenny", 400], ["Megan", 385], ["Alice", 365], ["Beth", 350], ["Becky", 320], ["Amanda", 300], ["Candice", 290], ["Jessica", 250], ["Mary", 220], ["Linda", 200]];
JavaScript Playlist:
• JavaScript for Beginners
MDN for Loops:
https://developer.mozilla.org/en-US/d...
Node JS:
nodejs.org
Visual Studio Code:
code.visualstudio.com