Open aminalakhsham opened 5 years ago
https://github.com/ca-g7/AMAI/blob/964a341fb1c8deb85b647d120ea3457c42f22e62/JS/index.js#L1-L9 try to make this function to don't repeat code
function getElements(nodesName, selectors) { const elements = {} if (nodesName.length === selectors.length) return 'Error'; selectors.map((selector, index) => elements[nodesName[index]] = document.querySelector(selector);) return elements; } const {a, b, c} = getElements(['a','b','c'], ['.a','.b','.c']);
https://github.com/ca-g7/AMAI/blob/964a341fb1c8deb85b647d120ea3457c42f22e62/JS/index.js#L1-L9 try to make this function to don't repeat code