Skip to content

Commit 4012732

Browse files
committed
Update instantiation example
1 parent 28d9b66 commit 4012732

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

JavaScript/3-instantiation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const benchmark = require('./2-benchmark.js');
44

55
function makeClosure(hello, size, flag) {
6-
return () => {};
6+
return () => ({ hello, size, flag });
77
}
88

99
function closureInstance() {
@@ -84,7 +84,7 @@ function itemFactory(hello, size, flag) {
8484
return { hello, size, flag };
8585
}
8686

87-
benchmark.do(10000000, [
87+
benchmark.do(1000000, [
8888
closureInstance,
8989
defineObject,
9090
defineArray,

JavaScript/3-instantiation.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
node --allow-natives-syntax 3-instantiation

0 commit comments

Comments
 (0)