diff --git a/src/app.js b/src/app.js index cc43cc2..83f6e37 100644 --- a/src/app.js +++ b/src/app.js @@ -26,14 +26,28 @@ const initPlayers = (players) => { let detailedPlayers = []; // Create players using for loop // Type your code here + for(let index=0;index{ + let random=Math.round(Math.random()) + return random===0?"hero":"villain" +} // getting random strength const getRandomStrength = () => { // Return a random integer (0,100] // Note: You can use Math.random() and Math.ceil() + return Math.round(Math.random()*100)+1 } const buildPlayers = (players, type) => { @@ -42,6 +56,16 @@ const buildPlayers = (players, type) => { // Loop through players and accumulate HTML template // depending of type of player(hero|villain) // Type your code here + for(let index=0;index + +
${players[index].name}
+
${players[index].strength}
+ ` + fragment+=temp + } + } return fragment; }