clojure.string/replace 与 ClojureScript 中的 .replace 有什么区别?
What is the difference between clojure.string/replace vs .replace in ClojureScript?
我尝试了两个选项:
(.replace my-string "string-to-replace" "new-string"))
和:
(.clojure.string/replace my-string "string-to-replace" "new-string"))
两者我都可以用,但我不知道有什么区别,你能解释一下吗?
(.replace my-string) - 这是 JavaScript 方法 String.prototype.replace()
(clojure.string/replace) 对于相同的 js 方法 a wrapper
我尝试了两个选项:
(.replace my-string "string-to-replace" "new-string"))
和:
(.clojure.string/replace my-string "string-to-replace" "new-string"))
两者我都可以用,但我不知道有什么区别,你能解释一下吗?
(.replace my-string) - 这是 JavaScript 方法 String.prototype.replace()
(clojure.string/replace) 对于相同的 js 方法 a wrapper