Can you directly manipulate a javascript variable in memory?

  Kiến thức lập trình

Can you directly edit a javascripts variable in memory, similar to how pointers work in C++?

I have the following example that works but just…feels unsafe to use:


const testFunction = async () => {
  x = x + 20
}

I realize that the global scope is in play here, but surely there’s a better way to manipulate the memory directly?

Thank you!

I was hoping there’s a more direct way of doing the manipulation, especially if the variable needs to be referenced over several files.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT