JavaScript
Fat arrow when it's not mandatory?

by Benny Neugebauer

describe('My module', function() {
  it('works', function() {
    expect('Hello').toBe('Hello');
  });
});

describe('My module', () => {
  it('works', () => {
    expect('Hello').toBe('Hello');
  });
});

Why would this not be '() -> {}' vs. '() => {}'?

Jeremy Micah Bassi

@jeremy this is ES6, not Coffeescript.

James DiGioia

Sign in to comment!