Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning ClojureScript

You're reading from   Learning ClojureScript Master the art of agile single page web application development with ClojureScript

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher
ISBN-13 9781785887635
Length 320 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Allen Rohner Allen Rohner
Author Profile Icon Allen Rohner
Allen Rohner
W. David Jarvis W. David Jarvis
Author Profile Icon W. David Jarvis
W. David Jarvis
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Getting Ready for ClojureScript Development FREE CHAPTER 2. ClojureScript Language Fundamentals 3. Advanced ClojureScript Concepts 4. Web Applications Basics with ClojureScript 5. Building Single Page Applications 6. Building Richer Web Applications 7. Going Further with ClojureScript 8. Bundling ClojureScript for Production

JavaScript interoperability

One of the most powerful things about ClojureScript is the ease with which one can access and interact with the JavaScript runtime. In this section, we'll take a closer look at how you can work with native JavaScript code from ClojureScript.

JavaScript collections

Odds are good that you won't want to work too much with JavaScript collections directly now that you've gotten an understanding of how powerful ClojureScript's collection objects are, but it's still important to know how to access these from ClojureScript as well as to make sure you're comfortable converting JavaScript data types to ClojureScript and vice versa. Learning about this syntax will also prove useful when calling JS libraries from ClojureScript.

Arrays

Following is an example of defining and then accessing a JavaScript array from the ClojureScript REPL:

cljs.user> (def a (array 1 2 3))
;; => #'cljs.user/a
cljs.user=> a
;; => #js [1 2 3]
cljs.user...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image