What does equal sign mean and more than sign (=>) in Javascript?
The Meteor Whatsapp project uses a file where "=>" is used, but my WebStorm IDE detects it as an error. I can not find any docs about this syntax.
chats.forEach( chat => {
let message = Messages.findOne({ chatId: { $exists: false } });
chat.lastMessage = message;
let chatId = Chats.insert(chat);
Messages.update(message._id, { $set: { chatId: chatId } })
});
Here is the GitHub repository for the bootstrap.js file
What is "=>"?
I was really going to try this question out, but googling searches were unexpectedly difficult if you still don't know his name. As you can see in the links in the comments, that function is a thick arrow (sometimes called only an arrow function).
this
: , new
, , , , , , undefined
( " " ) , , Function.prototype.bind
et al.
this
, ( Function.prototype.bind
), , , var. MDN (. ).
, , .
arguments
psuedo-array. ES 6.
arity 1 .