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
| highestProductOf3 = function (arrayOfInts) { | |
| if(arrayOfInts.length < 3){ // if provided array has less than 3 values then return false | |
| console.log('Less than 3 items!'); | |
| return false; | |
| } | |
| // we're going to start at the 3rd item (at index 2) | |
| // so pre-populate highests and lowests based on the first 2 items. |