Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

fred murrell
241 PointsString vs String Literals: what is the difference between a string and string literal? thanks
String vs String Literal: what is the difference and why?
2 Answers

Steven Parker
242,296 PointsThe term "string" is more generic and doesn't identify how it is being represented. For example:
name = "James"
This line has two strings, a string variable named "name", and a string literal providing the value being assigned to it.
You will sometimes hear a literal referred to as a "hard-coded value".

fred murrell
241 Pointsthank you. got it.
fred murrell
241 Pointsfred murrell
241 Pointsthank you . got it.