String types are implemented as read-only arrays since they belongs to the primitive types and hence, are immutable. Note that arrays are objects and so are mutable. Thus, the only way out is to simply makes string types as read-only arrays. Thus, we cannot change the value its characters; any attempt to change these values is silently ignored.
However, a welcome exception is that a string type still use Array's length property to store the length of the string.
To assign a string value to a string type, we can keep the string within quotes (double or single) and simply assign the value to varString. Thus, the statement, "varString = "The Hobbit";", assigns the text "The Hobbit" to the string variable, varString.
For equality operator, we can even pass values that are not string and the equality operator would automatically cast the non-string values into string values. The strict equality operator, is stricter and does not cast non-strings into strings.
In the example provided below, we can pass "101" (a string) and 101 (a number) to equality operator and the operator would automatically convert 101 into string before it begins the comparison. Hence, comparing "101" with 101 fails since the very types of these variables is not same, let aside their values!