Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If condition statement evaluate using eval? #5

Closed
stevemao opened this issue Jan 25, 2016 · 2 comments
Closed

If condition statement evaluate using eval? #5

stevemao opened this issue Jan 25, 2016 · 2 comments
Labels

Comments

@stevemao
Copy link

If condition statement evaluate using eval

I'm not sure if this is correct? According to mdn,

if (condition)
condition
An expression that evaluates to true or false.

My understand is function f() {} here is an function expression instead of function declaration so f is not a variable. Hence it's undefined.

Can you provide any reference of "If condition statement evaluate using eval"?

@sairion
Copy link

sairion commented Feb 20, 2017

I have also seen someone asking is this true on some forum. I don't think so, there is no mention of global eval() function being used in IfStatement in ECMA-262 https://es5.github.io/#x12.5

tmkuba added a commit to tmkuba/123-Essential-JavaScript-Interview-Question that referenced this issue May 30, 2018
Call, Apply, Bind question ganqqwerty#6 identical to question ganqqwerty#5
@ganqqwerty
Copy link
Owner

I read the standard and I agree that's you're right. I'm fixing it.

ganqqwerty pushed a commit that referenced this issue Jun 23, 2018
ganqqwerty pushed a commit that referenced this issue Jun 24, 2018
Call, Apply, Bind question #6 identical to question #5
ganqqwerty added a commit that referenced this issue Jun 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants