forof

Solutions on MaxInterview for forof by the best coders in the world

showing results for - "forof"
Daniel
19 Apr 2019
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']