Create a function named that takes a string (URL) as input. Decompose the string and return an object with the following properties:
null.null).null).["test", "image"] or null)nullnulldecomposeUrl("https://www.google.com/search/test.js?ok=1") ➞ {
protocol: "https",
ipAdress: null,
subDomain: "www",
domainName: "google.com",
folderTree: (1) […],
targetFile: "test.js",
argumentsFile: "?ok=1"
}
decomposeUrl("https://innokodakademija.com/new/challenge") ➞ {
protocol: "https",
ipAdress: null,
subDomain: null,
domainName: "innokodakademija.com",
folderTree: (1) […],
targetFile: "challenge",
argumentsFile: null
}
decomposeUrl("https://innokodakademija.com/new/challenge/test.html") ➞ {
protocol: "https",
ipAdress: null,
subDomain: null,
domainName: "innokodakademija.com",
folderTree: (2) […],
targetFile: "test.html",
argumentsFile: null
}
N/A