Reference JS string to C#

I’m trying to reference a string from a JS script and reference the value in a C# script. I know that I have to place the JS script in a special folder, but I don’t know the line of code to reference a JS script, I know to reference a C# is : string myusername = ScriptName.myusername . However I can’t seem to do the same for JS. Please help.

Also if it helps:
KongAPI = Script
MyUnityObject = Object
myusername = String

string myusername = gameObject.GetComponent().myusername;
if the js script is on the same GameObject or you can use a find,

string myusername = GameObject.Find(“MyUnityObject”).GetComponent().myusername;

Remember to try and not use find in Update, and your best to store a reference to it in Start.

Thanks for the quick reply, but it doesn’t work.
I tried the both of those scripts, I also tried

string myusername = MyUnityObject.GetComponent<KongAPI>().myusername;

They all give me an error

string myusername = (string)MyUnityObject.GetComponent<KongAPI>().myusername

What type is myusername? is it a string?

Sorry for the late reply, but yes it’s a String. It might be only a INT in the future though.

Can you paste the code for both parts, the C# and the JS?