javascript user defined exception handling code example Example: user defined exceptions in js throw new Error('Exception message');