how to throw an error in a function javascript code example Example: js throw error throw new Error('Whoops!')