0
我想要做的是同時獲得項目的列表,隱藏它們,並將它們分配給這樣的變量:如何做coffeescript或=正確?
jQuery ->
client_list or= $('.client-list').find('.actions').hide()
但這種休息和ActionController的說:Error: the variable "client_list" can't be assigned with ||= because it has not been defined.
我該如何解決這個問題?這甚至有可能嗎?
如果變量未被定義,爲什麼需要'|| ='運算符?你爲什麼不能分配? –
因爲這將是兩條線 - 我可以做兩行 - 想在一個 –