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
//just save a copy of this script under ./scripts/ | |
const fs = require("fs"); | |
/** returns an arrays with as many indexes as "target" appeards on input */ | |
const findIndexes = (input, target) => { | |
const indexes = []; | |
var currentIndex = 0; | |
while (currentIndex < input.length) { | |
currentIndex = input.indexOf(target, currentIndex) |