JSFiddle - React, Tailwind, and code Playground
by Adam Boduch
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.min.js"></script>
JavaScript
const str = 'some string { "a": 1, "b":2, "c": { "a":1 } } and another string';
const o1 = _.flow(_.bindKey(/\{.*\}/, 'exec', str), _.head, JSON.parse)();
const o2 = { "a": 1, "b":2, "c": { "a":1 } };
console.log()