Undefined string

Benchmark created on


Description

Different ways of creating the string 'undefined'

Preparation HTML

<script>
  var undefined_string = 'undefined';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
'undefined' literal
'undefined'
ready
'' + void 0
'' + void 0
ready
void 0 + ''
void 0 + ''
ready
String(void 0)
String(void 0)
ready
'' + undefined
'' + undefined
ready
undefined + ''
undefined + ''
ready
String(undefined)
String(undefined)
ready
String({}.x)
String({}.x)
ready
Variable reference to pre-built string
undefined_string
ready

Revisions

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