The book defines javascript variable with braces '{' which returns error "SyntaxError: Unexpected token { " on my compiler (npm 5.6.0)
I found the similar problem here (SyntaxError: Unexpected token { in javascript) which used function inside the variable but I am afraid this is not the right solution.
var variable_to_use = from_data(array){
for(var i = 0 ; i < array.length; i++ )
{
for ( var n = 0; n < array.length; n++ ) {
if ( array[n] > array[n+1]) {
var temp = array[n];
array[n] = array[n+1];
array[n+1] = temp;
}
}
}
return (array);
}