Check the length of a JavaScript Object as though it were an Array.