Timer function is executed with arguments of two ways

1. enclosed in quotes

2. then sets out functions

    function f(msg) {
        console.log(msg);
    }
    setTimeout("f('杨越')",2000);
    setTimeout(function () {
        f('杨越')
    },4000);

Guess you like

Origin www.cnblogs.com/ustc-yy/p/12074686.html