function Single(fn){ var ret; return function(){ return ret || (fn.apply(this,arguments)) } } var getInput = Single((params)=>{ return `this is ${params}` }) var string123 = getInput('123') var string1234 = getInput('234') console.log(string123 === string1234) console.log(string1234)