• Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Post job
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

126
Views
How can primitive data types have access to prototype?

How primitive data types (strings, numbers etc.) have access to methods like .toString(). We can even access to their proto's by typing variable.proto but they are not object.

over 1 year ago · Juan Pablo Isaza
1 answers
Answer question

0

JavaScript automatically converts primitives to String objects, so that it's possible to use String object methods for primitive strings.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String

over 1 year ago · Juan Pablo Isaza Report
Answer question
Find remote jobs