Created
May 3, 2017 04:34
-
-
Save bbalconi/d9d64852ef38cd762037ea9026181c04 to your computer and use it in GitHub Desktop.
comparison 4 mikie
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
function breakOut (array, changeValue, stopValue) { | |
for (var i = 0; i < array.length; i++) { | |
if (array[i] !== stopValue) { | |
array[i] = changeValue | |
} | |
else break | |
} | |
return array | |
} | |
function breakOut(array, changeValue, stopValue) { | |
for (let i = 0, l = array.length; i < l; i++) { | |
if (array[i] === stopValue) { | |
break | |
} | |
array[i] = changeValue | |
} | |
return array | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment