JavaScript Pattern add