Suppose box is a constructor, so are you doing new box() ?
If so...
Thus, the former will be more memory efficient than the latter.
First version:
new box box prototype object prototype +--------------+ +--------------+ +--------------+ | | | | | | | |--------->| open func |--------->| | | | / | | | | +______________+ / +______________+ +______________+ / / new box / +--------------+ / | | / | |/ | | +______________+
Second version:
new box box prototype object prototype +--------------+ +--------------+ +--------------+ | | | | | | | open func |--------->| |--------->| | | | / | | | | +______________+ / +______________+ +______________+ / / new box / +--------------+ / | | / | open func |/ | | +______________+
user1106925
source share