Created
August 18, 2021 06:44
-
-
Save pradeeprjth/f2ed94f1e85c1b235f96b51427b0ae46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear() | |
var mList = [1, 2, 3, 4, 5] | |
// var pos; | |
// for(pos = 0; pos < mList.length; pos++) { | |
// console.log('Position => ' + pos + ' Value => ' + mList[pos]) | |
// } | |
// Break Keyword | |
// var pos; | |
// for(pos = 0; pos < mList.length; pos++) { | |
// if(pos >= 3) break | |
// console.log('Position => ' + pos + ' Value => ' + mList[pos]) | |
// } | |
// Continue Keyword | |
var pos; | |
for(pos = 0; pos < mList.length; pos++) { | |
if(pos % 2 === 0) continue | |
console.log('Position => ' + pos + ' Value => ' + mList[pos]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment