

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gilles Ruppert &#187; Performance</title>
	<atom:link href="http://latower.com/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://latower.com</link>
	<description>a.k.a. elduderino78</description>
	<lastBuildDate>Thu, 05 Aug 2010 00:59:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Splitting a long JavaScript String across multiple lines</title>
		<link>http://latower.com/2008/11/splitting-a-long-javascript-string-across-multiple-lines/</link>
		<comments>http://latower.com/2008/11/splitting-a-long-javascript-string-across-multiple-lines/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 14:08:47 +0000</pubDate>
		<dc:creator>elduderino78</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://latower.com/?p=59</guid>
		<description><![CDATA[Whilst reading a comment by Mike DeBoer on Ajaxian about delimiting JavaScript strings with backslashes, I thought it&#8217;s worth mentioning it here as well, if only to remind myself. String concatenation always creates a new string. Thus, writing: var str = &#8230; <a href="http://latower.com/2008/11/splitting-a-long-javascript-string-across-multiple-lines/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Whilst reading a comment by <a href="http://www.mikedeboer.nl/">Mike DeBoer</a> on <a href="http://ajaxian.com/archives/how-to-structure-your-javascript-code#comment-268506">Ajaxian</a> about delimiting JavaScript strings with backslashes, I thought it&#8217;s worth mentioning it here as well, if only to remind myself.</p>
<p>String concatenation always creates a new string.</p>
<p>Thus, writing:</p>
<pre>
 <code>
var str = "This is a long" +
  " string. That's why we want to " +
  " split it over several lines";
 </code>
</pre>
<p>is slower &#038; more memory intensive than writing:</p>
<pre>
 <code>
var str = "This is a long\
 string. That's why we want to\
 split it over several lines";
 </code>
</pre>
<p>Just be careful you don&#8217;t have trailing spaces as that will mess it up.</p>
]]></content:encoded>
			<wfw:commentRss>http://latower.com/2008/11/splitting-a-long-javascript-string-across-multiple-lines/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
