I have created SharePoint hosted app which is written in JSOM in the SharePoint 2013, now I want to migrate only this code to SharePoint 2010. How can I achieve this activity in the easiest way?
JSOM 2013 is pretty similar with JSOM 2010. However, if you're using _api endpoint, you have to migrate your code with pure JSOM or try to migrate with SOAP webservices.
You could export your addin scripts into the "Style Library" and make an HTLM page with your page content then add a content editor webpart that call the HTML page.
Do not forget to clean the scripts in case you are retrieving SharePoint data. (Updating executors, using the current SP.ClientContext, updating ajax query to do not use any _api endpoints, ...)