2018-03-24 16:22:20 +05:30

13 lines
202 B
JavaScript

function f(arr) {
const MULTIPLIER = 5;
for (MULTIPLIER in arr);
return 'survived';
}
expect(function() {
f([1,2,3]);
}).toThrow('"MULTIPLIER" is read-only');
expect(f([])).toBe('survived');