All files / 2_Function/0_Normal ArrowFunction.js

50% Statements 25/50
0% Branches 0/10
3.85% Functions 1/26
83.33% Lines 25/30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56    1x 1x     1x 1x 1x         1x 1x     1x 1x 1x         1x 1x     1x 1x 1x         1x 1x     1x 1x 1x         1x 1x     1x 1x 1x      
export default function() {
  // No argument
  const arrowFunction01 = () => { return "foo"; };
  const arrowFunction02 = () => {
    return "foo";
  };
  const arrowFunction03 = () => "foo";
  const arrowFunction04 = () => ({ foo: "bar" });
  const arrowFunction05 = () => ({
    foo: "bar"
  });
 
  // Single argument without parenthesis
  const arrowFunction11 = foo => { return "foo"; };
  const arrowFunction12 = foo => {
    return "foo";
  };
  const arrowFunction13 = foo => "foo";
  const arrowFunction14 = foo => ({ foo: "bar" });
  const arrowFunction15 = foo => ({
    foo: "bar"
  });
 
  // Single argument with parenthesis
  const arrowFunction21 = (foo) => { return "foo"; };
  const arrowFunction22 = (foo) => {
    return "foo";
  };
  const arrowFunction23 = (foo) => "foo";
  const arrowFunction24 = (foo) => ({ foo: "bar" });
  const arrowFunction25 = (foo) => ({
    foo: "bar"
  });
 
  // Multiple arguments
  const arrowFunction31 = (foo, bar) => { return "foo"; };
  const arrowFunction32 = (foo, bar) => {
    return "foo";
  };
  const arrowFunction33 = (foo, bar) => "foo";
  const arrowFunction34 = (foo, bar) => ({ foo: "bar" });
  const arrowFunction35 = (foo, bar) => ({
    foo: "bar"
  });
 
  // Arguments with default values
  const arrowFunction41 = (foo = "=>", bar = "()") => { return "foo"; };
  const arrowFunction42 = (foo = "=>", bar = "()") => {
    return "foo";
  };
  const arrowFunction43 = (foo = "=>", bar = "()") => "foo";
  const arrowFunction44 = (foo = "=>", bar = "()") => ({ foo: "bar" });
  const arrowFunction45 = (foo = "=>", bar = "()") => ({
    foo: "bar"
  });
};