JSFiddle - React, Tailwind, and code Playground

JavaScript

var obj = {
       'a' : 'The fooman poured the drinks.',
       'b' : {
          'c' : 'Dogs say fook, but what does the fox say?'
       }
    }

    console.log (JSON.parse(JSON.stringify(obj).replace(/foo/g, 'bar')));