-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path6-functions.js
More file actions
43 lines (37 loc) · 1.01 KB
/
6-functions.js
File metadata and controls
43 lines (37 loc) · 1.01 KB
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
'use strict';
const benchmark = require('./2-benchmark.js');
const fnLambdaBlock = () => {};
// eslint-disable-next-line
const fnLambdaBlockU = () => { return; };
// eslint-disable-next-line
const fnLambdaBlockN = () => { return null; };
// eslint-disable-next-line
const fnLambdaBlock0 = () => { return 0; };
const fnLambdaExprU = () => undefined;
const fnLambdaExprN = () => null;
const fnLambdaExpr0 = () => 0;
const fnExpression = function() {};
const fnExpressionU = function() { return; };
const fnExpressionN = function() { return null; };
const fnExpression0 = function() { return 0; };
function fnDeclaration() {}
function fnDeclarationU() { return; }
function fnDeclarationN() { return null; }
function fnDeclaration0() { return 0; }
benchmark.do(10000000, [
fnLambdaBlock,
fnLambdaBlockU,
fnLambdaBlockN,
fnLambdaBlock0,
fnLambdaExprU,
fnLambdaExprN,
fnLambdaExpr0,
fnDeclaration,
fnDeclarationU,
fnDeclarationN,
fnDeclaration0,
fnExpression,
fnExpressionU,
fnExpressionN,
fnExpression0
]);