JSFiddle - React, Tailwind, and code Playground
HTML
<div id="output">
</div>
JavaScript
var b = JSON.parse('{"request": { "locale": "en-US", "timestamp": "2016-09-25T00:36:14Z", "type": { "name": "request", "slots": { "RequestTypeItem": { "name": "RequestTypeItem", "value": "req1" } } }}}');
console.log(b);
// loop through all properties on the slots object
for (var i in b.request.type.slots) {
if (b.request.type.slots.hasOwnProperty(i)) { // make sure it is a property belonging directly to slots, and not "inherited" from the prototype chain
if (b.request.type.slots[i].value) { // make sure that the sub-property of slots has a value property
document.getElementById("output").innerHTML = b.request.type.slots[i].value;
break; // only get the first one
}
}
}