Gowtham

by Pritesh Patel

JavaScript

/* 
return a Array with the new unique value
if file name exist then add copy word, 
if file name exist with copy then add 1 or increment the value
need to check against existing files as well as newely added file

*/
/* output will be = ['hello copy', 'hello copy 1', 'world copy 1', 'test', 'hello copy 2'] */

const filesToCopy = [
	'hello',				// = hello copy
  'hello copy',		// = hello copy 1
  'world',				// = world copy 1
  'test',					// = test
  "hello copy 1"  // = hello copy 2
];

const existingFiles = [
	'hello',
  'world',
  'world copy'
];

function suggestNames(filesToCopy) {
// Write code here;
}

console.log("SuggestNames: ", suggestNames(filesToCopy))