JS lazy evaluation and storing patterns