JavaScript runat=server
This function works fine:
function test() {
var a = {
"ar1": [1, 2, 3, 4, 5]
};
if (a.ar1.some(1)) {
return true
}
return false
}
test();
This does not. I get a syntax error:
function test() {
var a={"ar1":[1,2,3,4,5]};
if(a.ar1.some(x=> x==1)){
return true
}
return false
}
That same code works fine on the client side. Whenever I introduce an arrow function to my runat=server, I get an error.
Why?