I am trying to create a function in javascript which can't be called as constructor like lets say if function is function SomeFunction(){}
, on calling it like new SomeFunction()
it should throw an exception but calling it without new should work.
Is there a way to achieve this?