It all boils down to one thing, really: JavaScript is case sensitive. That's why it makes a distinction between Object
and object
.
Object
, Array
, Function
and Number
are not keywords, nor are they exactly "special" (whatever you think they mean) words.
They're nothing more than built-in function/class types in JavaScript (you can do a typeof
on them and see). You don't directly use them often now though since there are syntactic alternatives to creating objects of each of those types, for example:
var obj = {};
var func = function() {};
var arr = [];
var num = 123;
The others you mention (object
, array
, method
, number
, foo
) aren't keywords or "special" words either simply because, since as I say JavaScript is case sensitive, they mean nothing in JavaScript compared to their capitalized counterparts. Unless, of course, you give them meaning yourself by declaring variables with those names.