exam questions

Exam Magento 2 Certified Associate Developer All Questions

View all questions & answers for the Magento 2 Certified Associate Developer exam

Exam Magento 2 Certified Associate Developer topic 1 question 48 discussion

Actual exam question from Magento's Magento 2 Certified Associate Developer
Question #: 48
Topic #: 1
[All Magento 2 Certified Associate Developer Questions]

How do you obtain customer information in a JavaScript module?

  • A. Magento does not expose customer information in JavaScript for security reasons
  • B. By sending an AJAX request to the url: /customer/account/info/?json=1
  • C. By using customerData.get('customer') call, where customerData is an instance of Magento_Customer/js/customer-data
  • D. Customer information is available in localStorage and be retrieved by calling window.localStorage.getItem('customer')
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Reference:
https://belvg.com/blog/customer-data-management-in-magento-2.html

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago