Category: jQuery

Sum of array values in Javascript

How to sum of array values in Javascript ? Sample :- array.reduce(function(a,b){return a + b;},0) Example :-  let invoiceAmount = [1000, 1500, 2000]; invoiceAmount.reduce(function(a,b){return a + b;},0); The above code return if the array is NULL and return the calculate value. Sum of array values in Javascript Packers and Movers in Dubai

Generate CSV File in Javascript

How to Generate CSV File in Javascript //JSON DATAS var data = [ [‘Singaporean’, ‘Singapore’], [‘Indian’, ‘India’] ]; //CONVERT JSON Variant to TWO-DIMENSION Array var csvContent = ”; data.forEach(function(infoArray, index) { dataString = infoArray.join(‘;’); csvContent += index < data.length ? dataString + ‘\n’ : dataString; }); //Function to DOWNLOAD a file. var download = function(content, fileName, mimeType) { var a […]

jQuery Cookies | jQuery Cookie Example

Jquery Cookies is lightweight plugin to read, write data in session. Plugin File  : To Set Cookie : $.cookie(‘the_cookie’, ‘the_value’); Read Cookie : $.cookie(‘the_cookie’); // => ‘the_value’ Delete Cookie : $.cookie(‘the_cookie’, null);

jQuery | JSON | Filter condition in jQuery

How to FILTER specific column values in JSON ? The below example filter the DATAs. Whatever the column productId = 4. The results return to the skuDatasContainer as JSON structure Example : var skuDatasContainer = jQuery.grep(       skuDatas,         function (item,index) {             return item.productId == […]