made an inline for loop with JS