array indexing vs charAt

Benchmark created on


Description

문자열의 특정 자리 문자를 가져올 때 array indexing과 charAt 중 뭐가 빠른지 알아보는 테스트

Setup

const a = "String"

Test runner

Ready to run.

Testing in
TestOps/sec
array indexing
console.log(a[0])
ready
charAt
console.log(a.charAt(0))
ready

Revisions

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