I am using axios to get an element value that I need to handle it as a string.
const aa = await axios
.get(`document.querySelector('h2').innerText;`)
.then((r) => r.data.result.value);
console.log(aa);
then, I need to check for example if the element aa.startsWith("somestring")
, but is not accepted, even aa is logged in the console with the expected value.
In general, how could I convert the const result from axios into a string?