문제

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 know 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top