Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkAvailableConfirmTypes() {
- // variables
- let oldTypes = [
- {id: "2",text: "operator's call", show: true},
- {id: "4",text: "confirm by sms", show: true}
- ];
- let newTypes = {
- 0: "2",
- };
- //add a new Set from newTypes
- let tempSet = new Set();
- for(let item in newTypes) {
- tempSet.add(newTypes[item]);
- }
- //if oldTypes item hasn't got tempSet item.id -> show = false
- oldTypes.forEach((item)=> {
- !tempSet.has(item.id) ? item.show = false : item.show = true;
- });
- }
Add Comment
Please, Sign In to add comment