Объяснение:
var start = -1000;
var finish = 1000;
var sum = 0;
for (var i = start; i <= finish; i++) {
var last_digit = Math.abs(i) % 10; //if (last_digit === 2 || ...) if ([2, 3, 7].indexOf(last_digit) !== -1) sum += Math.abs(i); }
console.log(sum);
Объяснение:
var start = -1000;
var finish = 1000;
var sum = 0;
for (var i = start; i <= finish; i++) {
var last_digit = Math.abs(i) % 10; //if (last_digit === 2 || ...) if ([2, 3, 7].indexOf(last_digit) !== -1) sum += Math.abs(i); }
console.log(sum);