开发者

Javascript interop assignment in Clojurescript

开发者 https://www.devze.com 2023-04-09 02:27 出处:网络
Dumb question: how do I do Javascript assignment in Clojurescript ? I\'m using a Javascript lib and need to set the value of an object\'s field like obj.this=that; - I don\'t kn开发者_JS百科ow Javascr

Dumb question: how do I do Javascript assignment in Clojurescript ? I'm using a Javascript lib and need to set the value of an object's field like obj.this=that; - I don't kn开发者_JS百科ow Javascript so maybe there's a .set method ?


Try some thing like

(set! (.-property foo) 5)


Use

(aset foo "property" 5)

Be aware, that symbolic references may fail.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号