Le 12/06/2012 15:27, Hemanth H.M a écrit :
Would something like :

|obj["prop"] ||= "NewProp"|

be useful?
ahah, I asked the same question very recently [1]. Answer by Brendan Eich [2]. I definitely agree that default arguments are a decent alternative. I can't recall examples where it wouldn't be enough. Do you have use cases where you would use ||= and default argument values couldn't be used?

David

[1] https://twitter.com/DavidBruant/status/210654806732324864
[2] https://twitter.com/BrendanEich/status/210750515808706561
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to