Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doSomethingWithArray(arr) {
- doArray : {
- // check the array
- for (var i; i < arr.length; i++) {
- if (arr[i] === 0) {
- console.log('item at ' + i.toString(10) + 'is zero.');
- flag = true;
- break doArray;
- }
- }
- /* do something w/ the array ... */
- return arr;
- }
- return false;
- };
- doSomethingWithArray([1,4,6,3,5,8,0,1,2,7,3]);
Add Comment
Please, Sign In to add comment