JSFiddle - React, Tailwind, and code Playground
How to write a function that takes a string and object and interpolates that object in the string
by shubh0602
JavaScript
// interpolate("Its {weather} outside", {weather: 'damn Hot'})
// returns 'It's damn hot outside'
// interpolate( "Hi my name is {name}", {name: 'John'});
// returns 'Hi my name is John'
function interpolate(str, obj) {
}