Create a method print a string If type is not string then throw exception and retrun exception and retry 3 times
Script function printString(str) { if (typeof(str) === 'string') { return str } else { throw "string needed" } } try{ printString("hello") } catch(err){ console.log("error", err) }