Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

early exit js

if(page > pages) {
    return res.redirect('?page='+encodeURIComponent(pages)); // <- early exit
} else if(page < 1) {
    return res.redirect('?page='+encodeURIComponent('1')); // <- early exit
}
Source by es.stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #early #exit #js
ADD COMMENT
Topic
Name
9+8 =