Преглед изворни кода

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

Frederic G. MARAND пре 8 година
родитељ
комит
d5bbd0c346
1 измењених фајлова са 5 додато и 1 уклоњено
  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>');
   });