Skip to content

Topic Name : Hidden Use of eval #359

Description

@divyanshu-rawat

setTimeout and setInterval can also take a string as their first parameter.

function foo() {
    // will get called
}

function bar() {
    function foo() {
        // never gets called
    }
    setTimeout('foo()', 1000);
}
bar();

In node v7.3.0
Here setTimeout('foo()', 1000); will throw TypeError: "callback" argument must be a function

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions