how to use throw method in javascript code example Example: js throw error throw new Error('Whoops!')