1const files = [ 'foo.txt ', '.bar', ' ', 'baz.foo' ];
2let filePaths = [];
3
4for (let file of files) {
5 const fileName = file.trim();
6 if(fileName) {
7 const filePath = `~/cool_app/${fileName}`;
8 filePaths.push(filePath);
9 }
10}
11
12// filePaths = [ '~/cool_app/foo.txt', '~/cool_app/.bar', '~/cool_app/baz.foo']