Kill a running app using javascript code

I have developed an application with ionicframework, And having a requirement to keep a button called “Kill” , If I click on the same button I have to kill the same app.

Could you please inform me is there is any possibility to that feature using ionicframework.

If anything, you’re probably looking for a way to call something through Cordova, so it would probably be best to do a Google search for “cordova kill app” or similar. But killing an app is generally considered anti-pattern and to be avoided afaik.

Actually I came across this: http://ionicframework.com/docs/api/utility/ionic.Platform/

You’ll see ionic.Platform.exitApp() about half way down the page.