JSFiddle - React, Tailwind, and code Playground
JavaScript
var myObject = {
foo: 'a',
bar: 'b',
otherthings: [{
yep: '0',
yuk: 'yoyo0'
}, {
yep: '1',
yuk: 'yoyo1'
}],
foobar: 'yup',
value: null
};
var myStringObject = JSON.stringify(myObject);
var matches = myStringObject.match('yep');
alert(matches.length);