When working in bash, I typically use the following code:
for i in {0..2}; do echo x$i; done
However, when attempting to replicate this function in JavaScript with the following code:
for (var i=0; i<3; i++) {
console.log(x$i);
};
It is evident that this approach does not yield the desired result.
Is there a more simplified workaround available in JavaScript that mirrors the ease of use found in bash?