{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/immutable-js/issues/369","labels_url":"https://api.github.com/repos/facebook/immutable-js/issues/369/labels{/name}","comments_url":"https://api.github.com/repos/facebook/immutable-js/issues/369/comments","events_url":"https://api.github.com/repos/facebook/immutable-js/issues/369/events","html_url":"https://github.com/facebook/immutable-js/issues/369","id":60016014,"number":369,"title":"How works the conversion from JS arrays/objects?","user":{"login":"jardakotesovec","id":1590681,"avatar_url":"https://avatars.githubusercontent.com/u/1590681?v=3","gravatar_id":"","url":"https://api.github.com/users/jardakotesovec","html_url":"https://github.com/jardakotesovec","followers_url":"https://api.github.com/users/jardakotesovec/followers","following_url":"https://api.github.com/users/jardakotesovec/following{/other_user}","gists_url":"https://api.github.com/users/jardakotesovec/gists{/gist_id}","starred_url":"https://api.github.com/users/jardakotesovec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jardakotesovec/subscriptions","organizations_url":"https://api.github.com/users/jardakotesovec/orgs","repos_url":"https://api.github.com/users/jardakotesovec/repos","events_url":"https://api.github.com/users/jardakotesovec/events{/privacy}","received_events_url":"https://api.github.com/users/jardakotesovec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-05T21:07:40Z","updated_at":"2015-03-08T02:13:50Z","closed_at":null,"body":"> Designed to inter-operate with your existing JavaScript, immutable accepts plain JavaScript Arrays and Objects anywhere a method expects an Iterable with no performance penalty.\r\n> This is possible because immutable can treat any JavaScript Array or Object as an Iterable.\r\n\r\nI wonder what this exactly mean. I though that Immutable.js structures are always represented via tries structures. So I would expect that converting from JS Array/Object to Immutable would require some processing and creating these tries structures.  But quoted docs sounds like its using array/object directly.\r\n\r\nSo may I ask for brief explanation? Thanks!"},"comment":{"url":"https://api.github.com/repos/facebook/immutable-js/issues/comments/77728394","html_url":"https://github.com/facebook/immutable-js/issues/369#issuecomment-77728394","issue_url":"https://api.github.com/repos/facebook/immutable-js/issues/369","id":77728394,"user":{"login":"leebyron","id":50130,"avatar_url":"https://avatars.githubusercontent.com/u/50130?v=3","gravatar_id":"","url":"https://api.github.com/users/leebyron","html_url":"https://github.com/leebyron","followers_url":"https://api.github.com/users/leebyron/followers","following_url":"https://api.github.com/users/leebyron/following{/other_user}","gists_url":"https://api.github.com/users/leebyron/gists{/gist_id}","starred_url":"https://api.github.com/users/leebyron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leebyron/subscriptions","organizations_url":"https://api.github.com/users/leebyron/orgs","repos_url":"https://api.github.com/users/leebyron/repos","events_url":"https://api.github.com/users/leebyron/events{/privacy}","received_events_url":"https://api.github.com/users/leebyron/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T02:13:50Z","updated_at":"2015-03-08T02:13:50Z","body":"All Immutable.js collections implement the ES6 `Iterable` interface. JavaScript Array is in fact iterable in ES6-aware browsers (currently rare), but Immutable.js will wrap the array in a `Seq` in other browsers which is Iterable. Similarly for JS Object, as a convenience, will be wrapped in a `Seq` and iterated similarly to how an ES6 Map is iterated. These `Seq` wrappers have extremely low overhead, and are similar to the excellent [lazy.js](http://danieltao.com/lazy.js/) project in implementation.\r\n\r\nAll methods in Immutable.js which expect an `Iterable` argument internally have a simple check which first checks if the argument is Iterable, and if not, wraps it in a Seq so that it is Iterable before running the rest of the method.\r\n\r\nImmutable collections are in fact Trie structures, and since they implement the `Iterable` interface directly, aren't wrapped in `Seq` when provided to these kinds of methods.\r\n\r\nDoes that help explain?"}}