How does js terminate the program? return cannot change jfslk_javascript skills-js tutorial
Source: Internet
Author: User
Alert (3) is such a program that is not written in the function. I wonder, how can I end JavaScript? Jfslk can achieve the same effect (end js program) alert (3)
In this case, the program is not written in the function. I wonder, how can I end JavaScript?
Alert (3)
Return;
Alert (3)
If this write fails, return can only terminate the function.
I cannot find a solution on the Internet. Ask a friend. I can say no, and I can try die.
Alert (3)
Die;
Alert (3)
Wow, I admire it. It's a success.
Alert (typeof die)
What's going on: undefined, undefined, and the console reports an error
Alert (3)
Jfslk;
Alert (3)
Ah, it turns out that this jfslk can achieve the same effect (terminating the js program)
It turns out that errors can be used to terminate js programs, which is very useful! Does anyone use this ?!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.