JSFiddle - React, Tailwind, and code Playground

by joeycakes

HTML

<pre id="out"></pre>

JavaScript

function out(string){
    $('#out').append([string, "\n"].join(""));
}

var delimiter = ".",
    regex = new RegExp("\\.?(^\\.)", "g");
    data = {
        "shallow": null,
        "deep.key1": null,
        "deep.key2": null,
        "deep.arr.0": null,
        "deep.arr.1": null,
        "deep.arr.2": null
    },
    sanity = 100;

for(key in data){
    var s = 0;
    out("Testing key: <b>" + key + "</b>");
    out("------------------------------");
    while((s < sanity) && (m = regex.exec())){
        out(m[1]);   
        s++;
    }
}