JSFiddle - React, Tailwind, and code Playground

by Mark Polyakov

HTML

<div id="showresult"></div>

JavaScript

function select(selector){
        var selectObj=this;
        selectObj.where=function(where){
            //do whatever with where and select
            //add properties to the resulting object using selectObj.property=something
            //now add the and method
            selectObj.and=function(whatever){
                //do stuff with selector, where, and whatever
                return {selector:selector,where:where,whatever:whatever}
            }
            return selectObj;
        }
        return selectObj;
    }

document.getElementById('showresult').textContent=JSON.stringify(select("*").where("you='me'").and("me='him'"));