Jump to content

JS String | JS Object


shreyaskudav

Recommended Posts

What is the difference between a STRING and an OBJECT?
i suggest you "go to school" first !start here and work your way to the bottom of the list.don't quote me on this as proper def-n, but a STRING is a set of characters that is used as data, not the variables or functions, methods, etcan OBJECT is, ehm... the KEY "thing" you're dealing with in HTML/JS - read through that link, and you'll see what it is more clearly.
Link to comment
Share on other sites

The W3Schools Javascript tutorial explains what a string is http://www.w3schools.com/js/js_obj_string.asp and what an object is http://www.w3schools.com/js/js_obj_intro.aspThe difference? Well, they are hardly related to eachother in any way, besides being a data type.

Link to comment
Share on other sites

In JavaScript, everything is an object. The value of a string object is a series of characters, but the object also has properties and methods. In other languages, a string is only the characters.A string object is different from objects you create yourself in a very special way. When you write str = "hello", only the characters are overwritten. The methods and properties still exist (although the value of some properties, such as length, would be updated).This would not happen if you created a generic object and assigned a new value to it. In that case, all the objects properties and methods would be overwritten.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...