⭐️ Get contents on Javascript(and frameworks) basic to advanced topics with tips and tricks.
Follow on Instagram - @codecraftjs.
Available for Paid Mentoring 💻 .
Master Javascript!
You will get its type as function. The function can be treated as a value , as in javascript everything is an object. Even functions are objects. Functions can be assigned to a variable as well.
⭐️ Get contents on Javascript(and frameworks) basic to advanced topics with tips and tricks.
Follow on Instagram - @codecraftjs.
Available for Paid Mentoring 💻 .
Master Javascript!
Top comments (6)
damn. those are tricky!
Now that I've looked into them, I understand all of them except for question 1. how is a function declaration legal in an if statement?
Consider this -
You will get its type as
function. The function can be treated as a value , as in javascript everything is an object. Even functions are objects. Functions can be assigned to a variable as well.OK. I think I get it. Because a function declaration can be on the RHS of an assignment statement it can go in the middle of an if statement?
Checkout Part 1 as well !
I failed all of them lol