Explorar o código

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

Frederic G. MARAND %!s(int64=8) %!d(string=hai) anos
pai
achega
d5bbd0c346
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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>');
   });