get odd and even part of number using jquery
i have a 13 digit number and want extract odd and even part of this digit. i want to write truth checker function for EAN-13 barcode type that need calculate numbers of my digit. so i have an digi like…
i have a 13 digit number and want extract odd and even part of this digit. i want to write truth checker function for EAN-13 barcode type that need calculate numbers of my digit. so i have an digi like…
<script> var array1 = ['2023-04-05','2023-04-06','2023-04-07','2023-04-08']; //array1 var array2 = ['2023-04-06','2023-04-07']; //array2 found1 = array1.find((val, index) => { //find the date in array1 return array2.includes(val); }); $('.show').html(found1); </script> result 2023-04-062023-04-07 how to result like this 2023-04-06, 2023-04-07
I have 2 arrays of objects: array1 = [{"id":1,"cost":200,"qty":56},{"id":2,"cost":100,"qty":16}]; array2 = [{"id":1,"cost":200,"desc":"a good one"},{"id":2,"cost":100,"desc":"a bad one"},{"id":3,"cost":50,"desc":"an okay one"}]; I want to merge them so it looks like this: [{"id":1,"cost":200,"qty":56,"desc":"a good one"},{"id":2,"cost":100,"qty":16,"desc":"a bad one"}]; Please notice the new array has properties…
I have an array that I've confirmed has content, and the keys are correct. I'm trying to iterate through that array and put an image via the item.url key into an Antd Card element. Below is the code I have.…
I'm having a bit of an issue figuring this out. I have an array object per customer, per year of the month: [ { color: "#009192", data: [0, 0, 57.62, 0, 0, 0, 0, 0, 0, 0, 0, 0], label:…
Here, I have created an array that will print the output, but the second output did not give a valid result, like I work as a Web Dev in Ind. I want, but it prints I work as a Sam…
Suppose I have an object that looks like this const parent_obj = { 'metrics': [ ['2023-03-28 15:40:00+00:00', 1692.1, 1.0], ['2023-02-28 15:40:00+00:00', 1211.6, 0.0], ['2023-01-28 15:40:00+00:00', 763.1, 1.0] ] }; I want to have 2 arrays that look like this: var…
I have an array that contains negative numbers, empty string '', Zero 0 and positive numbers. I want to sort the array so that empty string '' always shows at the end. [-1, 2, '', -2, 0, 4, '', 1,5,0,…
Input arrays : var arr1 = [{EmpID:'1',Name:'PB',EmpCode:'10001'},{EmpID:'2',Name:'SS',EmpCode:'10002'}]; var arr2 = [{EmpID:'1',Address:'GGN'},{EmpID:'2',Address:'SP-GGN'}]; Expected Output : [{EmpID:'1',Name:'PB',EmpCode:'10001',Address:'GGN'},{EmpID:'2',Name:'SS',EmpCode:'10002',Address:'SP-GGN'}]; I tried below logic function fun(){ var arr1 = [{EmpID:'1',Name:'PB',EmpCode:'10001'},{EmpID:'2',Name:'SS',EmpCode:'10002'}]; var arr2 = [{EmpID:'1',Address:'GGN'},{EmpID:'2',Address:'SP-GGN'}]; var arr3= []; for(var k=0; k < arr1.length; k++){ arr3.push(arr1[k]); }…
I have an array that I wish to return the indexes in a new array if the original array matches a substring. Currently I am coding it like this: tv_show = ["bbc1_7.30","bbc1_8.00","itv1_8.40","bbc1_10.00"]; indexesFromSearch = []; tv_show.forEach(function(elem, index, array){ a0 =…