I'm learning JavaScript and while browsing through the jQuery library I see : (colon) being used a lot. What is this used for in JavaScript?
:
// Return an array of filtered elements (r) // and the modified expression string (t) return { r: r, t: t };
var o = { r: 'some value', t: 'some other value' };
is functionally equivalent to
var o = new Object(); o.r = 'some value'; o.t = 'some other value';
1.4m articles
1.4m replys
5 comments
57.0k users