I've a code like this:
jQuery.each(images, function (k, v) {
v = v.split(':');
data.questions.push({
source: questionAssetPath + v[0],
match: v[1],
mouse: mouseAssetPath + v[2] + '.png'
});
data.answers.push({
answer: v[1],
match: v[1]
});
});
When I run a grunt task (browserify:js), I've got this error:
ParseError: Unexpected token +
Please help me figure out of this.
Thanks you.
UPDATE:
I've solved it myself. Thanks guys. I've noticed that I can't use + operator with objects (wtf with me)
images = [
"maria-ozawa.png:MariaOzawa:1",
"aoi-125239.png:Aoi:2",
"sasha-grey.png:SashaGrey:3"
];
jQuery.each(images, function (k, v) {
v = v.split(':');
v[0] = questionAssetPath + v[0];
v[2] = mouseAssetPath + v[2] + '.png';
data.questions.push({source: v[0], match: v[1], mouse: v[2]});
data.answers.push({answer: v[1], match: v[1]});
});
+in your JSON, so provide JSON example where this error is happened.