Are pointers available in JavaScript

0 votes

Are pointers available in JavaScript?

I'm trying to understand if JavaScript supports pointers like in languages such as C or C++. I know JavaScript handles objects and arrays by reference, but I'm not sure if this is equivalent to having pointers. Could someone clarify whether JavaScript has pointers or a similar concept, and how references work in JavaScript?

10 hours ago in Web Development by Nidhi
• 3,520 points
17 views

1 answer to this question.

0 votes

No, there are no pointers in JavaScript.

JavaScript is a high-level programming language that abstracts away all memory management issues, such as pointers, which are ubiquitous in low-level languages like C and C++. Variables in JavaScript hold references to objects like arrays and objects. These references are not pointers in the same way that pointers are used in languages that handle memory on their own. JavaScript manages memory automatically through garbage collection. This means that coders don't have direct access to memory addresses and can't change pointers.

Key Points:

  • Primitive types (for example, number, string, boolean) are passed by value.
  • Objects (like arrays and objects) are passed as references, but these references are not pointers; they are managed by the JavaScript engine.
  • JavaScript abstracts direct memory access and uses automatic memory management instead of allowing pointers to be directly manipulated.
answered 9 hours ago by Navya

Related Questions In Web Development

0 votes
1 answer

In how many ways we can develop custom service make available in AngularJS?

Services:  A special unit of code which ...READ MORE

answered Jan 29, 2020 in Web Development by Niroj
• 82,840 points
674 views
0 votes
1 answer

Get current date in DD-Mon-YYY format in JavaScript/Jquery

Get Current Date In DD-Mon-YYY Format In ...READ MORE

answered Jun 28, 2022 in Web Development by rajatha
• 7,680 points
1,286 views
0 votes
1 answer

Get current date in DD-Mon-YYY format in JavaScript/Jquery

get current date in jquery in dd/mm/yyyy ...READ MORE

answered Jun 27, 2022 in Web Development by rajatha
• 7,680 points
6,294 views
0 votes
1 answer

Presenting docket dtates inside html page by javascript

Use the Docker Engine Api:Docker Engine API ...READ MORE

answered Jun 20, 2018 in Docker by DareDev
• 6,890 points
746 views
0 votes
1 answer

Migrating proxy npm repo in nexus 3

I don't think you can achieve this ...READ MORE

answered Jun 22, 2018 in DevOps Tools by DareDev
• 6,890 points
1,530 views
+1 vote
1 answer

What is the difference between JavaScript and Java

This quote rightly explains that 2 totally ...READ MORE

answered Jun 29, 2018 in Java by Daisy
• 8,140 points
793 views
+1 vote
1 answer

What are the different types of pop-up boxes available in JavaScript?

There are  basically three types of pop-up ...READ MORE

answered Jan 22, 2020 in Web Development by Niroj
• 82,840 points
1,611 views
+1 vote
1 answer

What are pseudo class in css??

Hey, The state of an element is controlled  by ...READ MORE

answered Jan 20, 2020 in Web Development by Niroj
• 82,840 points

edited Jan 21, 2020 by Niroj 919 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP