Jimmy's answer correctly represents the continuous JavaScript integer spectrum as -9007199254740992 to 9007199254740992 inclusive (sorry 9007199254740993, you might think you are 9007199254740993, but you are wrong! Demonstration below or in jsfiddle).
console.log(9007199254740993);
_x000D_
However, there is no answer that finds/proves this programatically (other than the one CoolAJ86 alluded to in his answer that would finish in 28.56 years ;), so here's a slightly more efficient way to do that (to be precise, it's more efficient by about 28.559999999968312 years :), along with a test fiddle:
/**_x000D_
* Checks if adding/subtracting one to/from a number yields the correct result._x000D_
*_x000D_
* @param number The number to test_x000D_
* @return true if you can add/subtract 1, false otherwise._x000D_
*/_x000D_
var canAddSubtractOneFromNumber = function(number) {_x000D_
var numMinusOne = number - 1;_x000D_
var numPlusOne = number + 1;_x000D_
_x000D_
return ((number - numMinusOne) === 1) && ((number - numPlusOne) === -1);_x000D_
}_x000D_
_x000D_
//Find the highest number_x000D_
var highestNumber = 3; //Start with an integer 1 or higher_x000D_
_x000D_
//Get a number higher than the valid integer range_x000D_
while (canAddSubtractOneFromNumber(highestNumber)) {_x000D_
highestNumber *= 2;_x000D_
}_x000D_
_x000D_
//Find the lowest number you can't add/subtract 1 from_x000D_
var numToSubtract = highestNumber / 4;_x000D_
while (numToSubtract >= 1) {_x000D_
while (!canAddSubtractOneFromNumber(highestNumber - numToSubtract)) {_x000D_
highestNumber = highestNumber - numToSubtract;_x000D_
}_x000D_
_x000D_
numToSubtract /= 2;_x000D_
} _x000D_
_x000D_
//And there was much rejoicing. Yay. _x000D_
console.log('HighestNumber = ' + highestNumber);
_x000D_