Top "Object-literal" questions

An object literal is a comma separated list of name value pairs wrapped in curly braces.

Call functions from function inside an object (object literal)

I'm learning to use object literals in JS, and I'm trying to get a function inside an object to run …

javascript function object-literal
JavaScript object literal length === undefined?

I am working on this animation function but I have a problem. I can't seem to perform what should be …

javascript object properties object-literal
dynamic keys for object literals in Javascript

Ok so I'm working away on a project in Nodes, and I've come across a small problem with the keys …

javascript object-literal
Template String As Object Property Name

Why does JavaScript not allow a template string as an object property key? For example, when I input: foo = {`bar`: …

javascript node.js object-literal template-strings template-literals
PHP object literal

In PHP, I can specify array literals quite easily: array( array("name" => "John", "hobby" => "hiking"), array("name" => "…

php object literals object-literal
Javascript 'colon' for labeling anonymous functions?

What does this code refer too? queryString: function() { //some code } I tested it in the WebConsole (Firefox) but it wouldn't …

javascript function anonymous-function object-literal colon
Can one set multiple properties inside an object literal to the same value?

For example, can I do this?: { a: b: c: d: 1, e: 2, geh: function() { alert("Hi!") } } EDIT: Is there some way …

javascript properties object-literal
Adding Prototype to JavaScript Object Literal

STORE = { item : function() { } }; STORE.item.prototype.add = function() { alert('test 123'); }; STORE.item.add(); I have been trying to figure …

javascript prototype object-literal
JavaScript - Advantages of object literal

I've read that rather than simply writing a bunch of functions, I should use object literal. Can someone explain what …

javascript object-literal
To count the number of objects in object literal using Jquery

Code: var animals = { "elephant": { "name" : "Bingo", "age" : "4" }, "Lion": { "name" : "Tango", "age" : "8" }, "Tiger": { "name" : "Zango", "age" : "7" } } I want to count the …

javascript jquery jquery-ui object object-literal