After being a freelance web developer for 12 years, I got a fulltime gig at Leadtech, Barcelona as a front-end developer. I'm the advocate of switching to Gutenberg blocks on our current WP web sites.
constanonymousAgeTeller=(age){console.log(`my age is ${age}`);}
This produces an error: Uncaught SyntaxError: Unexpected token '{'
Did you mean:
constanonymousAgeTeller=function(age){console.log(`my age is ${age}`);}
I'm sorry to be nitpicking but…
2+2// this is an arithmetic expression, // the + sign in this context is an arithmetic operator// not a function. Try console.dir(+), you get an error.
constanonymousAgeTeller=(age){console.log(`my age is ${age}`);}
This is actually a typo which I have corrected. Thanks again.
However in regards to the expression:
2+2
This is actually an arithmetic expression no doubt and as understand it, the addition operator is a special function that uses the infix notation and returns the value of adding its two operands.
So it is a function.
I did not fully understand you here.
After being a freelance web developer for 12 years, I got a fulltime gig at Leadtech, Barcelona as a front-end developer. I'm the advocate of switching to Gutenberg blocks on our current WP web sites.
Hi Lawrence,
first of all, I'd like to thank you for the article. I think it's brilliant! And thanks for getting back to me this quickly and fixing the typo.
I'll elaborate a bit on the + operator. What I meant, it's not a Function object. The compiler likely works with it as an infix function, but strictly speaking, it is not a Javascript function as such. I just believe that the example adds unnecessary confusion to the topic.
Hello, Honza,
Now I understand you better. I have removed those ambiguous sections of the article.
Thanks for helping improve the quality, you are appreciated.
After being a freelance web developer for 12 years, I got a fulltime gig at Leadtech, Barcelona as a front-end developer. I'm the advocate of switching to Gutenberg blocks on our current WP web sites.
Is this a typo?
This produces an error:
Uncaught SyntaxError: Unexpected token '{'
Did you mean:
I'm sorry to be nitpicking but…
Hello Honza, thanks for your observation.
This is actually a typo which I have corrected. Thanks again.
However in regards to the expression:
This is actually an arithmetic expression no doubt and as understand it, the addition operator is a special function that uses the infix notation and returns the value of adding its two operands.
So it is a function.
I did not fully understand you here.
Hi Lawrence,
first of all, I'd like to thank you for the article. I think it's brilliant! And thanks for getting back to me this quickly and fixing the typo.
I'll elaborate a bit on the
+
operator. What I meant, it's not aFunction
object. The compiler likely works with it as an infix function, but strictly speaking, it is not a Javascript function as such. I just believe that the example adds unnecessary confusion to the topic.Hello, Honza,
Now I understand you better. I have removed those ambiguous sections of the article.
Thanks for helping improve the quality, you are appreciated.
Thank you for sharing your insight with the community. I really appreciate your effort.