Fork me on GitHub
#clojurescript
<
2022-12-30
>
edye00:12:08

Hello, Is there a way to alias and refer to things in js/Math? Is there something like this: (:require [js/Math :as m :refer [PI cos]])

skylize01:12:46

Well you can use Math without the js qualifier, if that helps at all: Math/PI or Math.PI. I don't know about refer for Math, but if all else fails, you could always just (def pi Math.PI). (Unfortunately that drops metadata, such as docstrings.)

edye02:12:53

Thanks, that's good enough. It's just a small thing I was wondering about.