Skip to main content
12-Amethyst
December 20, 2017
Solved

Why I can not use 'return' keyword to stop script execution?

  • December 20, 2017
  • 1 reply
  • 1906 views

Why I can not use 'return' keyword to stop script execution? It should be supported in a javascript function.

Best answer by CarlesColl

Hi,

It's how it works, to return a value you should use var result = "value";

If you want to execute script execution anyway you can use break and block combination:

end: {

// Your code here

// if you want to break here: break end;

//  More code here

}

1 reply

1-Visitor
December 20, 2017

Hi,

It's how it works, to return a value you should use var result = "value";

If you want to execute script execution anyway you can use break and block combination:

end: {

// Your code here

// if you want to break here: break end;

//  More code here

}

zhuwenxi12-AmethystAuthor
12-Amethyst
December 20, 2017

It works perfertly. Thanks for your information.