Here is the snippet that I think is causing the issue.
The script works,
Array.prototype.remove = function(index){this.splice(index, 1);}
function buildNewDeck() {
'use strict';
var i;
...
but I cannot get jsLint to accept the code. (After reformatting for jsLint as follows)
Array.prototype.remove = function (index) {
'use strict';
this.splice(index, 1);
}
function buildNewDeck() {
'use strict';
var i;
...
I get the message
Unexpected ‘function’.
function buildNewDeck() {
line 14 character 1
Stopping. (30% scanned).
When I remove the Array.prototype, jsLint is error free.
When I relocate the Array.prototype to the end of the script I get the message
Expected ‘;’ and instead saw ‘(end)’.
}
for the code
this.splice(index, 1);
}
there is no whitespace after the semicolon.
As I say, the code works. I just can’t get jsLint to accept it as valid.