JSFiddle - React, Tailwind, and code Playground

JavaScript

var items = new Object();
    object.field1 = "test1";
    object.field2 = "test2";
    
    function showSpecificField(fieldName){ return items[fieldName]; }
    
    alert(items("field2"));// should alert the text "test2"
    alert(items("field1"));// should alert the text "test1"