Solved

in javascript what is =>

Posted on 2015-02-23
3
21 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
ID: 40625776
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
ID: 40734500
This is ES6 functions
0
 

Author Closing Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

896 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

11 Experts available now in Live!

Get 1:1 Help Now