I want to display all site collections for a given web application(Can be hard-coded url) using JSOM SharePoint 2010(No REST api). I have tried but couldn't complete it.
The JS CSOM only operates on the site you are currently on (You can open another client context but you need a site URL to do so). It does not allow you to do any operations based on the webapp level. If you want to execute those statements you need to user other ways.
A nice and simple approach would be to query the search via REST. You can apply a filter to only retrieve Sitecollections and you can also filter by path.
A filter for Sitecollections can be don't via the contentclass managed property with a value of sts_site.
Have a look here for some values you can use: