Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active May 31, 2021 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/6ba914b8f1f96041c936b348f242ce97 to your computer and use it in GitHub Desktop.
Save McLarenCollege/6ba914b8f1f96041c936b348f242ce97 to your computer and use it in GitHub Desktop.

Write a function names getExamResult that accepts the students marks of three subjects as arguments and returns the strings "pass" or "fail" depending on whether he has passed or failed .For passing the average score should be greater than or equal to 40. Please use the ternary operator to solve this question. Dont use if-else.

// Write your function here
function ...



// Here we will test our function with some input values
let geometryScore = 55;
let historyScore = 15;
let englishScore = 48;

console.log(getExamResult(geometryScore, historyScore, englishScore));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment