I have a Json object coming from the localStorage and I need it to be converted to a Long type, in the case entidadeId
idEntidade = localStorage.getItem("idEntidade");
var entidadeId = JSON.parse(idEntidade);
I have a Json object coming from the localStorage and I need it to be converted to a Long type, in the case entidadeId
idEntidade = localStorage.getItem("idEntidade");
var entidadeId = JSON.parse(idEntidade);
As JavaScript is not a strongly typed language, I suggest you just convert your number to a number, as follows:
idEntidade = Number(localStorage.getItem("idEntidade"));