const vs var

Benchmark created by peter on


Test runner

Ready to run.

Testing in
TestOps/sec
const
const one = 1;
const two = "two";
const three = {
  "key": "three"
};
const four = ["one", "two", "three", "four"];
const five = {
  "key1": 2,
  "key2": 3,
  "key3": three
};

console.log(one, two, three, four, five);
ready
var
var one = 1;
var two = "two";
var three = {
  "key": "three"
};
var four = ["one", "two", "three", "four"];
var five = {
  "key1": 2,
  "key2": 3,
  "key3": three
};

console.log(one, two, three, four, five);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.