What would be the equivalent of Javascript’s "with" in Coffeescript

Asked

Viewed 29 times

0

Hello, I was studying this new "language" that seems promising when I came across it. There is no such expression in Coffeescript or something similar?

  • That one reply @bigown says that with is not recommended because it brings ambiguity. Because I would like to use a function where using is not recommended?

  • @Marconi, for one more matter of whim, I think it looks elegant visually.

1 answer

2


Coffeescript eliminated the use of with, if you try to use you will receive a message from syntax error.

The very use of with javascript is not recommended, it is considered deprecated and should be removed in the near future.

In that O'Reilly’s reference book from Coffeescript the Author uses the with as an example of parts of javascript that Coffeescript anticipated and removed.

  • 1

    Thank you, that was very helpful :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.