As an exercise to help learn JS, I wrote a short bit of code that defines an array of random integers and then randomly logs one of them. Here's the code:
var turkey = true
var crud = []
for (i=0;i<10;i++) {
j = abs(Math.random()* 10);
crud.push[j];
}
while (turkey) {
console.log(crud[abs(Math.random()*10)]);
turkey = false;
}
This code returns a syntax error saying abs is not defined. I think I need to import a module but am not sure which one or how. Some help?
Also, if there's a more elegant way to do what I'm doing here, all input is welcome. :)