replace some `for` loops with `.map` and `.concat` and `.indexOf`
publish version 1.0.10