Skip to content

Commit

Permalink
I have added function to compare scores Codecademy#65
Browse files Browse the repository at this point in the history
  • Loading branch information
kailinwei authored Oct 27, 2020
1 parent 5d620ab commit 75ac8cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/assets/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,14 @@ export default {
startingInstructions: `Press 'p' to play, 'b' to build your own, or 'c' to contribute.`,
unpause: `un(P)ause`,
};
const existingHighScore=number;

const possibleSaying =["Wow! Same high score!", "Amazing, new high score!", "Maybe next time"]

currentScore=(score)=>{
if (score==existingHighScore){console.log(possibleSaying[0])}
if (score>existingHighScore){console.log(possibleSaying[1])}
if(score<existingHighScore){console.log(possibleSaying[2])}
}

currentScore();

0 comments on commit 75ac8cd

Please sign in to comment.