Thursday, 15 May 2014

javascript - I really like the ruby way of allowing "isACar?" method names, but how to do it in js? -



javascript - I really like the ruby way of allowing "isACar?" method names, but how to do it in js? -

i know 1 way not practical:

var = {'isacar?': function(){}} a['isacar?']()

i this

a.isacar?()

thanks

there no way access property question mark in name using dot-notation in javascript, starts ternary operator.

javascript

No comments:

Post a Comment