On 8/29/10, booksort <[email protected]> wrote:
> You know how a minor typo can sometimes stop JavaScript working
> completely, with no clues to the cause? There will probably just be an
> 'undefined' error somewhere else. It may take hours to spot the
> mistake.
> I've been got more than once after absent-mindedly using the PHP
> string concatenator '.' in JavaScript.
> Anything Firebug can do to spot errors like this would probably be
> very welcome.
> Keep up the good work!
>
That "." is a property accessor operator in javascript. When appearing
to the right of a string value, as in

"foo" .slice

- "foo" is converted to a String object and a slice property is
retrieved from that object.

"foo" . "bar" does not do string concatenation in javascript; that
would be a syntax error. To perform string concatenation, use "+"
operator or use String.prototype.concat.

"foo".concat("bar", "bang", 12, true);

Garrett

-- 
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en.

Reply via email to