On Mon, Oct 16, 2017 at 6:51 PM, sebb <seb...@gmail.com> wrote: > The '&' array intersection character does not seem to behave as > expected in Ruby files that display HTML. > > Is this a known issue? > Is there a work-round? > > For example: > > _p ["a","d"] & ["a","c"] > > works fine in a .cgi file, but generates '0' in views/pmc/pmc.js.rb for > example
Short answer: _p _.difference(["a","d"] & ["a","c"]) Longer answer: js.rb files are converted into javascript, and the "&" operator means something different in Javascript. LInks: https://whimsy.apache.org/roster/app.js http://whimsy.local/roster/app.js http://underscorejs.org/#intersection https://github.com/rubys/ruby2js/blob/master/README.md - Sam Ruby