A lot of the JavaScript challenges have the comment “Test your code by modifying these values” at the bottom followed by a function or something to execute.
I can’t figure out how to easily execute the code after I change this last line. The only option seems to be to “Run the Tests”.
Is there anyway to execute the code without selecting the “Run the Tests” button?
A workaround I have been doing is changing the code to set a variable equal to the function and doing a console log. See below. This does display the results in the bottom pane without having to “Run the Tests”.
I am checking with the community to see if there is a better way.
Workaround:
Change:
// Test your code by modifying these values
checkObj(“pet”);
To:
// Test your code by modifying these values
var test = checkObj(“pet”);
console.log(test)