Convert to string using template literal vs String() (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Template Literal on integer
`${5}`
ready
String() on integer
String(5)
ready
Template Literal on float
`${5.55}`
ready
String() on float
String(5.55)
ready
Template Literal on string
`${'foo'}`
ready
String() on string
String('foo')
ready
Template Literal on undefined
`${undefined}`
ready
String on undefined
String(undefined)
ready
Template Literal on null
`${null}`
ready
String() on null
String(null)
ready

Revisions

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