Print to a file for Android using Javascript

So I need to print many things from the games into .txt or any file extension.

I’ve read some questions and answer, but some is from about 2-3 years ago that I’m not sure still valid, some in C#, and some I don’t even understand how I write the into the file, how I make the file…

Sorry for being so noob, but how do I do this? If I asked it wrongly, maybe please also tell me where I could ask or get enlightenment about this…

Watch this tutorial PERSISTENCE - SAVING AND LOADING DATA which shows a method as to how to read and write data using binary formatter.