isTrue

Benchmark created on


Preparation HTML

<script>
function isTrue(val) {
    return Boolean(val).valueOf()
}
</script>

Setup

const str = 'I am a string'
const obj = { foo: true}
const bool = false
const arr = [1, 2, 3]

Test runner

Ready to run.

Testing in
TestOps/sec
Simple
!!str
!!obj
bool
!!arr
ready
isTrue
isTrue(str)
isTrue(obj)
isTrue(bool)
isTrue(arr)
ready

Revisions

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