safeNav (v90)

Revision 90 of this benchmark created on


Preparation HTML

<script>
var testFunc = (data) => f1?.f2?.map(e => e?.f3.map(el => el?.name))

var testFunc2 = (data) => result.array.map(e => e.groups.map(el => el.name))

var n = {
	f1: {
		f2: [
	{
		name: 'name1',
		salary: 300,
		age: 28,
	},
	{
		name: 'name2',
		salary: 400,
		age: 29,
	},
	{
		name: 'name3',
		salary: 500,
		age: 30,
	},
	{
		name: 'name4',
		salary: 600,
		age: 31,
	},
	{
		name: 'name5',
		salary: 700,
		age: 32,
	},
]
	}
};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
safe navigation
var testFunc = (data) => f1?.f2?.map(e => e?.f3.map(el => el?.name))

var n = {
	f1: {
		f2: [
	{
		name: 'name1',
		salary: 300,
		age: 28,
	},
	{
		name: 'name2',
		salary: 400,
		age: 29,
	},
	{
		name: 'name3',
		salary: 500,
		age: 30,
	},
	{
		name: 'name4',
		salary: 600,
		age: 31,
	},
	{
		name: 'name5',
		salary: 700,
		age: 32,
	},
]
	}
testFunc(n)
ready
non prototype
var testFunc2 = (data) => result.array.map(e => e.groups.map(el => el.name))

var n = {
	f1: {
		f2: [
	{
		name: 'name1',
		salary: 300,
		age: 28,
	},
	{
		name: 'name2',
		salary: 400,
		age: 29,
	},
	{
		name: 'name3',
		salary: 500,
		age: 30,
	},
	{
		name: 'name4',
		salary: 600,
		age: 31,
	},
	{
		name: 'name5',
		salary: 700,
		age: 32,
	},
]
	}
testFunc2(n)
ready

Revisions

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