by Jacek Schae

A visual overview of the similarities and differences between ClojureScript and JavaScript

yb95ipxLMDBVN2fSgxmuR-7SrZMXL7rrIRkE

If you ever wondered how different — or similar — ClojureScript and JavaScript are, then this article should help answer this question. And hopefully it’ll surprise you a couple of times.

Code examples are available via GitHub Gist at the bottom of the article.

Basics

NIzTLoEw8L77hQcVJgd-nVU1hbTl3GELXrvF

Collections

DOKuPTE7vsHWdbx3pWbvswnWgfTtzMkWONfJ

Functions

lQ2u2-n63CKtqmOWOVj6q1EBqsHUwQWZ11YX

Flow Control

mPc8ZDCTn7i82lvQWQ59Ehm5XK05IVRNTUBO

Truthiness

QVePUMtLZu8cPv635AIYbxgq8xCcn2K4Iq15

State

3pHviW6Eua17S2Ucuyk1llF1PKHogllBmm0u

Interop

seQApwVa9rlMgqYDwpDj5inmxD2SqheaxDeP

Here are those code examples:

JavaScript Examples
ClojureScript Examples

If you enjoyed this article, and would like to be notified when I release similar stories, consider following me on Medium and Twitter.

Thanks to Brian Craft and Mike Fikes for catching the `cond` error, which has been corrected.