Shreyas arya

Generation

generate functionFri, 10 Feb 2023

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

Script var myName = 'Johan'; function throwException(myName) { if (typeof myName != 'string') { throw 'myName should be a string'; } } throwException(myName)

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