length function for object javascript code example Example: javascript object length var size = Object.keys(myObj).length;