How does JavaScript .prototype work?

I’m not that into dynamic programming languages, but I’ve written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works?

I remember a lot discussion I […]

Disable/enable an input with jQuery?


Which is the standard way? And, conversely, how do you enable a disabled input? jQuery 1.6+ To change the disabled property you should use the .prop() function.

jQuery 1.5 and below The .prop() function doesn’t exist, […]

Creating multiline strings in JavaScript

I have the following code in Ruby. I want to convert this code into JavaScript. what’s the equivalent code in JS?

Update: ECMAScript 6 (ES6) introduces a new type of literal, namely template literals. They have many features, variable […]

Validate decimal numbers in JavaScript – IsNumeric()

What’s the cleanest, most effective way to validate decimal numbers in JavaScript? Bonus points for: Clarity. Solution should be clean and simple. Cross-platform. Test cases:

@Joel’s answer is pretty close, but it will fail in the following cases: