I'm not aware of any built-in capability for code folding for js files. It's a feature I would love to have though. It's sometimes hard to read through a long js file, and would be great to collapse regions. Maybe someone knows of a third party tool that does that...