I get an error when testing the following code in Safari.
var temp_color = null; var temp = 0; var tempv = 0; for (let x in colorblock) { temp_color = colorblock; tempv = Math.pow((color.r - temp_color.r), 2) + Math.pow((color.g - temp_color.g), 2) + Math.pow((color.b - temp_color.b), 2); if (x === 0) { temp = tempv;
Safari gives me the error message "Unexpected use of the reserved word" let "in strict mode", but it works when I use Chrome.
javascript safari
吴天哲
source share