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 weightMascases = [12,32,21,29]; | |
| var hasLightOverWeight = bagWeight.some (function (bagWeight) { | |
| returnMachineWeight> 30; | |
| }); | |
| console.log (hasPlantLightTable); // true |
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 weightMascases = [12,32,21,29]; | |
| var hasWeightPacking = false; | |
| for (var i = 0; i <weightMas.length; i ++) { | |
| if (weightOf Bags [i]> 30) { | |
| hasMaleOverWeight = true; | |
| } | |
| } | |
| console.log (hasPlantLightTable); // true |
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 students = [ | |
| {name: 'adam', age: 18}, | |
| {name: 'brian', age: 20}, | |
| {name: 'charles', age: 24} | |
| ]; | |
| var allLarestStudents = students.every (function (student) { | |
| return student.ity> = 18; | |
| }); | |
| console.log (allBiggest Students); // true |
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 students = [ | |
| {name: 'adam', age: 18}, | |
| {name: 'brian', age: 20}, | |
| {name: 'charles', age: 24} | |
| ]; | |
| var allLarestStudents = true; | |
| for (var i = 0; i <students.length; i ++) { | |
| if (students [i] age <18) { | |
| allLarestStudents = false; | |
| break; |
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 students = [ | |
| {name: 'adam'}, | |
| {name: 'brian'}, | |
| {name: 'charles'} | |
| ]; | |
| var student = students.find (function (student) { | |
| return student.name === 'brian'; | |
| }); | |
| console.log (student); // {"name": "brian"} |
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 students = [ | |
| {name: 'adam'}, | |
| {name: 'brian'}, | |
| {name: 'charles'} | |
| ]; | |
| var student; | |
| for (var i = 0; i <students.length; i ++) { | |
| if (students [i] .name === 'brian') { | |
| student = students [i]; | |
| break; // avoid scrolling through the rest of the list |
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 students = [ | |
| {name: 'adam', age: 15}, | |
| {name: 'brian', age: 18}, | |
| {name: 'charles', age: 20} | |
| ]; | |
| varLarest students = students.filter (function (student) { | |
| return student.ity> = 18; | |
| }); | |
| console.log (MajorStudents); | |
| // [{name: 'adam', age: 18}, {name: 'brian', age: 20}] |
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 students = [ | |
| {name: 'adam', age: 15}, | |
| {name: 'brian', age: 18}, | |
| {name: 'charles', age: 20} | |
| ]; | |
| varLarest students = []; | |
| for (var i = 0; i <students.length; i ++) { | |
| if (students [i] age> = 18) { | |
| MajorStudents.push (students [i]); | |
| } |
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 numbers = [1,2,3]; | |
| double var = numbers.map (function (number) { | |
| return number * 2; | |
| }); | |
| console.log (numbers); // [1,2,3] | |
| console.log (double); // [2,4,6] |
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 numbers = [1,2,3]; | |
| double var = []; | |
| for (var i = 0; i <numbers.length; i ++) { | |
| double.push (numbers [i] * 2); | |
| } | |
| console.log (numbers); // [1,2,3] | |
| console.log (double); // [2,4,6] |