I don't understand why I get the error message when I run JSLint with a JavaScript file.
I get the message var os_map = {}; Problem at line 28 character 36: Use the array literal notation [].
if I run this code in JSLint. The options for the JSLint as the following.
/*jslint onevar: true, browser: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, strict: true, newcap: true, immed: true */
Claiming object (, which is {}
) should be okay, but JSLint suggets to use an empty array (, which is []
)
Update: I found an answer. I was wrong. There's nothing wrong with var os_map = {}
. The code was shown in an error message because I did not use "require strict";
. I got the error message wrong. Thanks for answering my questions.