Test Join vs Stringify for array of strings comparison

Benchmark created on


Setup

const myValues1 = ['test1', 'test2', 'test3'];
const myValues2 = ['test1', 'test2', 'test3'];

Test runner

Ready to run.

Testing in
TestOps/sec
Test comparison with join
if (myValues1.join(';') === myValues2.join(';')) {
	// Do nothing
}
ready
Test comparison with JSON.stringify
if (JSON.stringify(myValues1) === JSON.stringify(myValues2)) {
	// Do nothing
}
ready

Revisions

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