How can I use Lodash in JavaScript?

Hi!
How can I use Lodash in JavaScript of Edge Actions?
The documentation says: "Use to call this library (e.g.` .includes ())).
I do not understand how to use it.
Give an example please.

Link To Octave Lodash in Action Runner.

Lodash is available only in cloud actions

Thank you!
I did not pay attention to the fact that only in Cloud Action.
I needed work Lodash on the device.

Hi Vitaly, any specific function you are looking for in lodash?

Hi Didier!

I needed functions in the Edge Action: the mean, maximum and minimum values of the array.

В Суб, 21/03/2020 в 08:20 +0000, Didier Lahay via Sierra Wireless Forum пишет:

Thanks !
Are the values stored in a VR on your device?

Yes.

В Суб, 21/03/2020 в 08:52 +0000, Didier Lahay via Sierra Wireless Forum пишет:

Example of how you can implement within the edge action:

  //var array = Datahub.read("/virtual/array/value",0).value;
   var array = [1,2,3,4,5,6,7,8,9];

var max = Math.max.apply(Math,array);
var min = Math.min.apply(Math,array);

//average
var sum = 0;
for(var i=0; i<array.length; i++) {
	sum += array[i];
}
var mean = sum / array.length;

Thank you! I did in a similar way.

1 Like