Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:     Problem at line 1 character 1: Missing "use strict" statement.   Doing some searching, I realized that some people add "use...
I was recently comparing the current version of json2.js with the version I had in my project and noticed a difference in how the function expression was created and self executed.  The code used to wrap an anonymous function in parenthesis and the...
I came across the following line  hsb.s = max != 0 ? 255 * delta / max : 0;   What do the ? and : mean in this context?...
Is it possible to do something like this?  var pattern = /some regex segment/ + /* comment here */     /another segment/;   Or do I have to use new RegExp() syntax and concatenate a string? I'd prefer to use the literal as the code is both more...
I've seen public exports of ES6 modules done in both of the following ways:  // method 1 export var getAnswer = function () { return 'forty two'; };  // method 2 export default function () { return 'forty two'; };    Are both of...
A thought struck me as I was writing a piece of JavaScript code that processed some floating point values. What is the decimal point symbol in JavaScript? Is it always .? Or is it culture-specific? And what about .toFixed() and .parseFloat()?  If I...
Is there any way to have nested objects in JSON so I don't have to make arrays out of everything? For my object to be parsed without error I seem to need a structure like this:  {"data":[{"stuff":[     {"onetype":[...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.