From 615777ffd94c75d9ca809ac033f81140e212c476 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 11 Jul 2016 16:09:38 +0200 Subject: [PATCH] clarifying some code --- js/privatebin.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index dc50785..b3e27bb 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -251,7 +251,7 @@ $(function() { sprintf: function() { var args = arguments; - if (typeof arguments[0] == 'object') + if (typeof arguments[0] === 'object') { args = arguments[0]; } @@ -334,12 +334,13 @@ $(function() { */ translate: function() { - var args = arguments, messageId, usesPlurals; - if (typeof arguments[0] == 'object') + var args = arguments, messageId; + if (typeof arguments[0] === 'object') { args = arguments[0]; } - if (usesPlurals = $.isArray(args[0])) + var usesPlurals = $.isArray(args[0]); + if (usesPlurals) { // use the first plural form as messageId, otherwise the singular messageId = (args[0].length > 1 ? args[0][1] : args[0][0]);