var extend = require('../../extend'),
  root = hexo.config.root;

extend.helper.register('js', function(path){
  if (!Array.isArray) path = [path];

  var result = [];

  path.forEach(function(item){
    if (item.substr(item.length - 3, 3) !== '.js') item += '.js';
    if (item.substr(0, 1) !== '/') item += root;

    result.push('<script type="text/javascript" src="' + item + '"></script>');
  });

  return result.join('\n');
});
@@ -124,16 +124,22 @@
 .isArray
+(path)
 ) path =
@@ -309,15 +309,21 @@
 tem 
-+
 = root
+ + item
 ;%0A%0A 
@@ -439,8 +439,9 @@
 n');%0A%7D);
+%0A

Fix bug of js()