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