Shreyas arya

Generation

generate functionFri, 10 Feb 2023

Create a method to throw an exception if does not print a string

Script function add(a, b) { if(typeof a !== "string" || typeof b !== "string") { throw "Inputs must be a string"; } else { console.log(a + " " + b); } }

Want to kickstart your project?Use the new AI Studio to create your code