Search This Blog
Monday, August 8, 2022
looping the object in Javascript
Friday, August 5, 2022
Loop the array with find method and pushing in new array
const inventory = [
{
districtId: "B01",
districtName: "Araria",
employeeId: null,
regionId: "EAST",
regionName: "EAST",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B02",
districtName: "Araria",
employeeId: null,
regionId: "EAST",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B03",
districtName: "Araria",
employeeId: null,
regionId: "EAST",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B04",
districtName: "Araria",
employeeId: null,
regionId: "SOUTH",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B05",
districtName: "Araria",
employeeId: null,
regionId: "WEST",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B06",
districtName: "Araria",
employeeId: null,
regionId: "NORTH",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B04",
districtName: "Araria",
employeeId: null,
regionId: "NORTH",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B05",
districtName: "Araria",
employeeId: null,
regionId: "WEST",
stateId: "BHN",
stateName: "BHN",
userId: "26",
},
{
districtId: "B06",
districtName: "Araria",
employeeId: null,
regionId: "NORTH",
stateId: "BHN",
stateName: "BHN",
userId: "26",
}
];
region = [];
inventory.forEach(element => {
if(!region.find(x => x.regionId == element.regionId ))
{
this.region.push(element)
}
});
console.log(region)
Validating to select in sequencial order using angular
< input type = "checkbox" (change) = "handleSelectTaskItem($event, taskItem)" [checked] = " taskItem . i...
-
Step1: Welcome to designer blog, Here we are going to discuss about how to connect ADO.net to Sql Server. Step2: using System; using ...
-
Welcome to designers blog here i have posted how to set xamp open localhost:8080 instead of just oepning localhost and Making the change ...
-
Step1: Welcome to designers bog Step1: SqlConnection con = new SqlConnection(@"data source=VAIO\SQLEXPRESS; database=Sam...