The other answers address your second question. In response to your first question about why it is not available in JavaScript, the short answer is that these days it can, thanks to HTML5 and the Web Storage spec.
As far as I understand, there is no big technological difference that gave Flash an advantage in having storage for so long while JavaScript is only recently gaining access. Instead, the difference is that Flash is managed by one company (Adobe) and can move at its own pace, implementing whatever features they want to. However, implementing a new feature natively in the browser means lots of discussion about how it will be implemented and standardized because there are many different browser vendors that need to support the feature.
Here is a good read on some of the history of Web Storage and its current state: http://diveintohtml5.info/storage.html