skip to Main Content

Javascript – why is it consoling an empty array?

const testFolder = '../assets'; const fs = require('fs'); const array=[] const pattern=/gif/ fs.readdir(testFolder, (err, files) => { files.map(file => { if(file.search(pattern)>0) array.push(file) }); // console.log(files) }); console.log(array) It should be printing an array of all the files containing .gif extension…

VIEW QUESTION

Reactjs – Regex: Not operator with grouped selection

As below pattern (currentStore.*?}.*?=.*?useApp) which search for a pattern like this: const {currentStore} = useApp(); But I need a pattern which search for a content where assignation of currentStore is happening like below(Not(currentStore.*?}.*?=.*?useApp)): currentStore = await MultiStoreService.getStoreInfoByLocation(zipCode, subdistrict); I mean…

VIEW QUESTION
Back To Top
Search