I have a class with a method which is instanced as a object. When element is clicked this should call object method. Both calls work. However, I expected 2nd call to have delay of 75000. However, there is no delay at all. It makes second call without any delay. I am using ECMAScript6 here.
class Test {
foo(x){
switch (x) {
case 1:
alert('test1')
break;
case 2:
alert('test2');
break;
}
}
}
var test = new Test();
$('#test-trigger').click(function() {
test.foo(1);
setTimeout(test.foo(2),75000)
});