From 975ae6706b4ac868425193cf25bcbbb268051b5d Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Wed, 18 Jul 2018 16:28:24 +0530 Subject: handle empty array in comparison --- js/NonLinear/LOOKUP_c.js | 2 +- js/NonLinear/TrigFun.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'js/NonLinear') diff --git a/js/NonLinear/LOOKUP_c.js b/js/NonLinear/LOOKUP_c.js index c31dddf6..3dcaacb9 100644 --- a/js/NonLinear/LOOKUP_c.js +++ b/js/NonLinear/LOOKUP_c.js @@ -160,7 +160,7 @@ function LOOKUP_c() { } if ((SaveExit)) { var xp = find(orpar.slice(1-1,oipar[1-1])>=0); - if ((xp!=[])) { + if ((xp.length!=0)) { this.model.firing = new ScilabDouble([orpar[xp[1-1]-1]]); } else { this.model.firing = new ScilabDouble([-1]); diff --git a/js/NonLinear/TrigFun.js b/js/NonLinear/TrigFun.js index 97b73bf3..776e2309 100644 --- a/js/NonLinear/TrigFun.js +++ b/js/NonLinear/TrigFun.js @@ -28,7 +28,7 @@ function TrigFun() { if (!ok) { break; } - if (find(PREVAR_FF==this.fun)==[]) { + if (find(PREVAR_FF==this.fun).length==0) { message("Sorry but "+this.fun+" is not in the list!"); throw "user error"; } else { -- cgit