I have the following:
function refreshGrid(entity) {
var store = window.localStorage;
var partitionKey;
...
...
I would like to exit from this function if an “if” condition is met. How can I exit? Can I just say break, exit or return?
The
returnexits the function returningundefined.The
exitstatement doesn’t exist in javascript.The
breakstatement allows you to exit a loop, not a function. For example:This also works with the
forand theswitchloops.