Acessing variables

Benchmark created by Enzo on


Setup

var names = {
        uno: 'uno',
        dos: 'dos',
        tres: 'tres',
    }
    
    var data = {
        uno: {
            dos: {
                tres: "hola mundo"
            }
        }
    };

Test runner

Ready to run.

Testing in
TestOps/sec
Static
data.uno.dos.tres;
ready
Dynamic 1
data.uno.dos[names.tres];
ready
Dynamic 2
data.uno[names.dos][names.tres];
ready
Dynamic 3
data[names.uno][names.dos][names.tres];
ready

Revisions

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