create a custom exception in javascript code example Example: how to raise exception in js throw new Error('Exception message');