0

I'm really confused about what this '=>' symbol is doing in a basic node.js tutorial that I just try to learn to.

This is the used of the syntax:

http.createServer((req,res)=>{
  res.writeHead(200, {'Content-type':'text/html'});
  res.end('<h1>Hello NodeJS</h1>');
})

I'm a php developer and really want to try Node.js, just stuck and curious about this specific symbol mean and I try to google it but failed.

Imam Assidiqqi
  • 516
  • 4
  • 20
  • They are called `arrow functions`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions – jfriend00 May 21 '16 at 03:29
  • [Arrow function](http://stackoverflow.com/questions/34361379/arrow-function-vs-function-declaration-expressions-are-they-equivalent-exch) – jfriend00 May 21 '16 at 03:30

0 Answers0