According to this page https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words
You can't use these reserved words as variables, but can you use them this way apperantly:
var test = {
break : 'whatever',
case : 'whatever',
if : 'whatever',
in : 'whatever'
//etc
};
I have a fiddle here with all the values http://jsfiddle.net/9RQ9j/4/
And I get no errors either defining them or calling for instance like this
console.log(test.if)
So to me it seems possible, but is it in conflict with the javascript spec? Then it seems at least like all the browsers I have tested in (which are most) do violate the spec and allow you to use those words.
(UPDATE: seems to fail in IE 8 + possibly other IE's)
And is it even good practice?
Last question: Is this ok?
var test = {
'break' : 'whatever',
'case' : 'whatever',
'if' : 'whatever',
'in' : 'whatever'
};