Solved

in javascript what is =>

Posted on 2015-02-23
3
20 Views
Last Modified: 2015-04-25
In javascript what does this mean => when using in context.

For example

 const run = {
    "←": ([x, y]) => [x - 1, y],
    "→": ([x, y]) => [x + 1, y],
    "↓": ([x, y]) => [x, y - 1],
    "↑": ([x, y]) => [x, y + 1] 
  };

Open in new window

0
Comment
Question by:stargateatlantis
  • 2
3 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
Comment Utility
Hi,
as far as I know this is not "pure" Javascript as this operator "=>" is not specified.

But Typescript has such constructs to manage expectations and to provide some kind of type safe programming functionality.
Please have a look here in the specs:
http://www.typescriptlang.org/Content/TypeScript%20Language%20Specification.pdf

HTH
Rainer
0
 

Accepted Solution

by:
stargateatlantis earned 0 total points
Comment Utility
This is ES6 functions
0
 

Author Closing Comment

by:stargateatlantis
Comment Utility
The question wasn't answered.  The arrow functions are part of javascript ECMA 6
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now