Last active
September 14, 2020 19:54
-
-
Save rajaramtt/fd5e18bbe3b0c51d42f54b233da2c36e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
{ | |
"goodPackage": { | |
"upsellList": [ | |
{ | |
"productCode": "product1" | |
} | |
] | |
}, | |
"betterPackage": { | |
"upsellList": [ | |
{ | |
"productCode": "product2" | |
} | |
] | |
}, | |
"bestPackage": { | |
"upsellList": [ | |
{ | |
"productCode": "product4" | |
}, | |
{ | |
"productCode": "product3" | |
} | |
] | |
} | |
} | |
*/ | |
const betterPackageCodes = this.hostingUpsellProducts.bestPackage.upsellList.map(prod => ([prod.productCode])); | |
/* | |
[ | |
{ | |
"name": "Prod 1", | |
"productCode": "prod1", | |
}, | |
{ | |
"name": "Prod 2", | |
"productCode": "prod2", | |
}, | |
{ | |
"name": "Product 3", | |
"productCode": "prod3", | |
} | |
] | |
*/ | |
const selectedProducts = this.selectedProduct.map(prod => ({ productCode: prod.productCode })); // only get the prodcts | |
const uniqueChannelID = Number([...new Set(array)].join()); | |
Author
rajaramtt
commented
Sep 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment