How Can I Save / Load This?

Hello,
I am currently trying to figure out how to create a Save / Load System in Unity. All i need to save though is a simple integer to say what level i am on. I would like to save it to a .txt file so i can read it later. but all of this i would like to code using JavaScript. I have my integer saved on that so it would make it much easier for me.
Thank You.

The only case in which playerprefs do not work is in web applications, otherwise you must not be accessing it correctly. Here’s the proper code for it (in c#):

public void SaveLevel (int lvl)
{
    PlayerPrefs.SetInt ("Level", lvl);
    PlayerPrefs.Save ();
}

public int LoadLevel ()
{
    return PlayerPrefs.GetInt ("Level", 1);
}

public void ResetLevel ()
{
    PlayerPrefs.SetInt ("Level", 1);
}

javascript would look something like…

function SaveLevel (lvl)
{
    PlayerPrefs.SetInt ("Level", lvl);
    PlayerPrefs.Save ();
}

function LoadLevel ()
{
    return PlayerPrefs.GetInt ("Level", 1);
}