You cannot override or define keywords in javascript.
So no, this is impossible to do.
As for your example, as @Lightness Races in Orbit commented , this example does not make sense, since you don't have static typing in javascript (unlike java , C# , etc.)!
var x = "12"; x = 12; x = true; x = function (){
All acting!
so let's say you could define string as var , this will make sense to you:
string x = "12"; x = 12; x = true; x = function (){
There will be no errors, but ?!
source share