Browse Source

Listing 5.14: string building with array.join().

Frederic G. MARAND 9 years ago
parent
commit
d5bbd0c346
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Chapter 5/05.js

+ 5 - 1
Chapter 5/05.js

@@ -21,7 +21,11 @@ $(document).ready(function () {
   var $notes = $('<ol id="notes"></ol>').insertBefore('#footer');
   $('span.footnote').each (function (index) {
     $(this)
-      .before('<sup>' + (index + 1) + '</sup>')
+      .before([
+        '<sup>',
+        index + 1,
+        '</sup>'
+      ].join(''))
       .appendTo($notes)
       .wrap('<li></li>');
   });