JSFiddle - React, Tailwind, and code Playground

JavaScript

var x = (function(){
        var x=0, y=2, z=5;
    
        return {
            toast: 123,
            test1: function(arg){
                return this[arg];
            },
            test2: function(a){
                return eval(a)
            }
        };
    }());

    console.log(x.test1("toast")); // 123
    console.log(x.test2("y")); // should return 2