declaring variables before for() would be faster, 85ms

var findDisappearedNumbers = function(nums) {
var len = nums.length+1;
var result = [];
for (var i = 1;i<len;i++){
if(nums.indexOf(i) === -1){
result.push(i);
}
}
return result;
};

@1425831934 hey, use 'indexOf' once already spends O(n) time, so it seems the time complexity of this method is O( n power 2 ). Then TLE problem occurs.