This should be super simple.
Using Vanilla JS, I am simply attempting to update the innerHTML of a span element with whichever session ID I am getting back from a function.
See example below :
sessionId = 0_77b1f7b5-b6c8-49a0-adbc-7883d662ebba
document.getElementById("sessionID").innerHTML = sessionId
However, running it does not have any effects from my HTML/JS files.
Running the above in the Browser Console returns (in Firefox, but same happens in Chrome):
Uncaught SyntaxError: numeric separators '_' are not allowed in numbers that start with '0'
I do need this session ID as it is (0 and underscore and all).
I looked at the Firefox Doc (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Identifier_after_number) and found that adding '' like '0_77b1f7b5-b6c8-49a0-adbc-7883d662ebba' then work.
However, when I receive this data, I cannot seem to be able to String() it.
Object { sessionId: "0_77b1f7b5-b6c8-49a0-adbc-7883d662ebba", modules: (1) […] }
sessionId = String(setupCompleteData.sessionId)
console.log("TEST : ", sessionId)
TEST : 0_77b1f7b5-b6c8-49a0-adbc-7883d662ebba
Would you have any idea how to go around this?
Thanks a lot !