This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>createElement vs. cloneElement</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var Benchmark = require('benchmark') | |
var suite = new Benchmark.Suite; | |
function createList() { | |
return [1, 2, 3, [[4]], [[[5]]], [6], [[7]]]; | |
} | |
function flattenRecursive (list) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function ( global ) { | |
'use strict'; | |
var Promise, PENDING = {}, FULFILLED = {}, REJECTED = {}; | |
if ( typeof global.Promise === 'function' ) { | |
Promise = global.Promise; | |
} else { | |
Promise = function ( callback ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function ( global ) { | |
'use strict'; | |
var Promise, PENDING = {}, FULFILLED = {}, REJECTED = {}; | |
if ( typeof global.Promise === 'function' ) { | |
Promise = global.Promise; | |
} else { | |
Promise = function ( callback ) { |