Question: JavaScrip Problems #12. Refactor the previous code: create a function 'test' which has 1 argument called 'guess'. This function will return the string values you
JavaScrip Problems
#12.
Refactor the previous code: create a function 'test' which has 1 argument called 'guess'. This function will return the string values you previously used console.log() on. Then execute that function given (4) and the returned result should automatically print out in the console (being the last value in the console.)
Previous Code - use this to refractor:
answer = 4; guess = "just dead"; if (isNaN(guess)) console.log("no numbers given"); else console.log( answer == parseInt(guess) ? "correct": "wrong");
Output:

Last console values correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
