Hi,

This is ES6 syntax, you can take a look at this guide
http://es6-features.org/, section Arrow Functions.

I think this guide is easy to understand, they have comparison also between
arrow and non-arrow function.

On Wed, May 18, 2016 at 10:42 AM, <jekil...@prodigy.net> wrote:

> Hello;
> I have been doing browser javascript since 2003. I have also been doing
> php on the serverside. But I have become very interested in exploring
> node.js.
>
> In the documentation on the Node.js site I see example code with
> constructs I am not familiar with:
>
> sample 1 syntax
>   fs.unlink('/tmp/hello', (err) => {
>   if (err) throw err;
>   console.log('successfully deleted /tmp/hello');
> });
>
> I am unfamiliare with "(err) =>". I have not seen this in javascript before
>
> then there is:
>
> sample 2 syntax
> fs.watch('somedir', (event, filename) => {
>   console.log(`event is: ${event}`);
>   if (filename) {
>     console.log(`filename provided: ${filename}`);
>   } else {
>     console.log('filename not provided');
>   }
> });
>
> I am unfamiliar with this construct: "${event}".
> I have seen this in php as variable variable references.
> But this is not php. I was of the understanding that $ is
> a valid and non special chararcter that can be used as
> and identifier (although it shows up as the reference to
> matches return from regex function)
>
> Is there some published documentation that would clarify
> and explain these constructs for me?
>
> Thank you for time and attention.
>
> PS I have successfully set up an http server with some elaborations based
> on
> instructions from the Apress publication 'Beginning Node.js'
>
> My set up services background requests of external css source files, image
> files
> designated for background rules, and external javascript files. But I am
> uncertain
> how an actuall "ajax" xmlHttpRequest object request would be handled from
> the
> server's standpoint.
>
> Thanks anew
>
> JK
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/1e621a81-3269-43f4-a985-5ced49124a69%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/1e621a81-3269-43f4-a985-5ced49124a69%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Nguyen Hai Duy
Mobile : 0914 72 1900
Skype: nguyenhd2107

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAGOR8-0k-Am9AjAMMeB9RMj6Dne5WnoaseLkWBwR9cXaofGRpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to