Created
May 22, 2020 14:49
-
-
Save michhub-dev/209ec0a81cd7c4e16225fdbf383dfa1b to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/lanegil
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
var sim = [ "mtn", "glo", "airtel"]; | |
var uppercasedCategories = []; | |
//explicit iteration | |
for(var i=0; i<sim.length; i=i+1){ | |
var cash = sim[i]; | |
if( cash !== undefined) { | |
if(cash.indexOf("last") ===0){ | |
break; | |
} | |
uppercasedCategories.push(sim[i].toUpperCase()); | |
} | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var sim = [ "mtn", "glo", "airtel"]; | |
var uppercasedCategories = []; | |
//explicit iteration | |
for(var i=0; i<sim.length; i=i+1){ | |
var cash = sim[i]; | |
if( cash !== undefined) { | |
if(cash.indexOf("last") ===0){ | |
break; | |
} | |
uppercasedCategories.push(sim[i].toUpperCase()); | |
} | |
} | |
</script></body> | |
</html> |
This file contains hidden or 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
var sim = [ "mtn", "glo", "airtel"]; | |
var uppercasedCategories = []; | |
//explicit iteration | |
for(var i=0; i<sim.length; i=i+1){ | |
var cash = sim[i]; | |
if( cash !== undefined) { | |
if(cash.indexOf("last") ===0){ | |
break; | |
} | |
uppercasedCategories.push(sim[i].toUpperCase()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment