Error:

Create empty object

var h = {};

Create object with properties

var h = { key: 'value', 'long-key': 'long-value' };
// logs 'value'
console.log(h['key']);

Add property to the object

var h = {};
h['key'] = 'value';

Check if the key is present in the object

var obj = { key: 'value' };
// check if key exists
if ('key' in obj) {
}

// check if key exists and not inherited
if (obj.hasOwnProperty('key') {
}

Delete property from object

var h = { key: 'value', 'long-key': 'long-value' };
// h is { key: 'value' }
delete h['long-key'];

Iterate over all properties of the object

var h = { key: 'value', 'long-key': 'long-value', foo: undefined };
 in h) {
    console.log(k.toString() + ' = ' + ((typeof h[k] === "undefined") ? 'undefined' :  h[k].toString()));
}

Get object's properties' names

var h = { key: 'value', 'long-key': 'long-value' };

// Enumerable
// keys is [ 'key', 'long-key' ]
var keys = Object.keys(h);

// Non-enumerable
var s = new String('test');
// props is ['0', '1', '2', '3', 'length']
var props = Object.getOwnPropertyNames(s);

Create deep copy of the object

var h = { key: [1, 2, 3], 'long-key': 'long-value' };
var h2 = JSON.parse(JSON.stringify(h))

Check if object is undefined

if (typeof obj === "undefined") {
    alert("is undefined");
}

Get type of variable

// boolean, number, string, function, object, undefined
var s = typeof obj;

Get prototype for instance

var s = new String('foo');
var p = Object.getPrototypeOf(s);
// "p === String.prototype" is true

Get all methods of instance

// Own methods
var s = new String('one');
for (var name in s) {
    if (typeof s[name] === 'function')
        console.log(name);
}

// Prototype's methods
var prototype = Object.getPrototypeOf(s);
var props = Object.getOwnPropertyNames(prototype);
for (var i in props) {
    var name = props[i];
    if (typeof prototype[name] === 'function')
        console.log(name);
}