JongMin Posted March 16, 2016 Share Posted March 16, 2016 (edited) Hi, there. As far as I know, in javascript, dot is used to access to an object property. But please see the following snippet: var greeting = "Hi!";var x = greeting.toUpperCase(); As you can see, typeof greeting is string which is primtive type and has no method or property. But how can the toUpperCase() method be used after the variable greeting? Could you explain a bit? Thanks Edited March 16, 2016 by JongMin Quote Link to comment https://forums.phpfreaks.com/topic/301010-object-accessor/ Share on other sites More sharing options...
requinix Posted March 16, 2016 Share Posted March 16, 2016 The "string" type will be coerced to the "String" type, which does have methods and properties. Quote Link to comment https://forums.phpfreaks.com/topic/301010-object-accessor/#findComment-1532037 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.