Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
Thursday, February 25, 2016
Use return instead of exit in Javascript
In PHP, we use exit function to exit a loop. We should not use exit in Javascrip.
The following statement in JS is wrong
if(fromTUG_id==null || fromTUG_id==undefined ||fromTUG_id==0) {
exit;
}
We should use return instead:
if(fromTUG_id==null || fromTUG_id==undefined ||fromTUG_id==0) {
return;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment