Understanding the types in JavaScript