Last active
August 29, 2015 14:17
-
-
Save LNA/13178c620bde35721afb to your computer and use it in GitHub Desktop.
Concat & Conj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(concat [1 2 3] 4) | |
=> gives an error. Remember, concat wants to squish together 2 differnt collections of data. | |
(conj [1 2 3] 4) | |
=> gives [1 2 3 4]. Sucessfully adds an item to a collection. Added it to the end because the coll is a vector. | |
(concat [1 2 3] [4]) | |
=> gives [1 2 3 4]. concat wants to squish togeter 2 different coll of data to form 1 coll of data. | |
(conj [1 2 3] [4]) | |
=> gives [1 2 3 [4]]. conj wants to add an item to a coll. And the item you gave it was a vector. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment