Top "Object" questions

An object is any entity that can be manipulated by commands in a programming language.

Checking if a key exists in a JavaScript object?

How do I check if a particular key exists in a JavaScript object or array? If a key doesn't exist, …

javascript arrays object
What is the most efficient way to deep clone an object in JavaScript?

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but …

javascript object clone
Converting an object to a string

How can I convert a JavaScript object into a string? Example: var o = {a:1, b:2} console.log(o) console.log(…

javascript string object serialization tostring
Convert JS object to JSON string

If I defined an object in JS with: var j={"name":"binchen"}; How can I convert the object to JSON? …

javascript json string object
Iterate through object properties

How does the variable propt represent the properties of the object? It's not a built-in method or property. Why does …

javascript loops object
How to avoid null checking in Java?

I use object != null a lot to avoid NullPointerException. Is there a good alternative to this? For example I often …

java object nullpointerexception null
Detecting an undefined object property

What's the best way of checking if an object property in JavaScript is undefined?

javascript object undefined object-property
How do I check if an object has a key in JavaScript?

Which is the right thing to do? if (myObj['key'] == undefined) or if (myObj['key'] == null) or if (myObj['key'])

javascript object
How do I copy an object in Java?

Consider the code below: DummyBean dum = new DummyBean(); dum.setDummy("foo"); System.out.println(dum.getDummy()); // prints 'foo' DummyBean dumtwo = …

java object copy clone
How to add an object to an array

How can I add an object to an array (in javascript or jquery)? For example, what is the problem with …

javascript arrays object