ruby - How to use min in formula -
how min
within formula evaluate using eval()
.
[5,6].min
works fine doesn't work within formula eval([5,6].min*5)
.
here way using #eval
. why need #eval
?
eval('[5,6].min * 5') # => 25
simply [5,6].min * 5
work you.
ruby eval
No comments:
Post a Comment