diff --git a/src/app.js b/src/app.js index cc43cc2..e69a668 100644 --- a/src/app.js +++ b/src/app.js @@ -26,7 +26,21 @@ const initPlayers = (players) => { let detailedPlayers = []; // Create players using for loop // Type your code here - + for(var i=0;i { const getRandomStrength = () => { // Return a random integer (0,100] // Note: You can use Math.random() and Math.ceil() + let s = Math.ceil(Math.random() * (100-1) + 1); + return s; } const buildPlayers = (players, type) => { @@ -41,8 +57,16 @@ const buildPlayers = (players, type) => { // Loop through players and accumulate HTML template // depending of type of player(hero|villain) - // Type your code here + + // Type your code here + for(var i=0;i
${players[i].name}
${players[i].strength}
`; + } + } return fragment; } // Display players in HTML @@ -55,4 +79,4 @@ const viewPlayers = (players) => { window.onload = () => { viewPlayers(initPlayers(PLAYERS)); -} \ No newline at end of file +}