This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-01
Channels
- # announcements (6)
- # beginners (68)
- # calva (5)
- # cider (3)
- # clara (1)
- # clojure (49)
- # clojure-europe (24)
- # clojure-nl (2)
- # clojure-norway (28)
- # clojure-seattle (1)
- # clojure-uk (5)
- # clojurescript (3)
- # conjure (5)
- # core-typed (6)
- # data-science (1)
- # datalevin (3)
- # datascript (3)
- # datavis (1)
- # datomic (19)
- # events (2)
- # fulcro (6)
- # gratitude (1)
- # helix (6)
- # hyperfiddle (19)
- # joyride (6)
- # lsp (20)
- # music (1)
- # nbb (12)
- # pathom (2)
- # pedestal (10)
- # re-frame (3)
- # reitit (3)
- # ring (5)
- # shadow-cljs (26)
- # yamlscript (17)
If I have a file named backup.js
with the contents const data = [ { "foo": "bar" } ]
, what is the best way to eval and read that data without needing to modify the file?
ok. That's about what I figured. Wanted to make sure there wasn't something else I was missing
So, it seems like doing that, I can read it if it's var data =
but not const data =
I was trying to do it with js/data
which only worked for var
but not const
or let
data
was the var that was defined inside the eval-ed file. I was trying to refer to it using js/
but your way works.