Returns the root of a path, or empty string if not absolute
The input path
The root path, or '' if not absolute
root('c:/foo/bar') // returns 'c:'root('foo/bar') // returns ''root('/foo/bar') // returns '/' Copy
root('c:/foo/bar') // returns 'c:'root('foo/bar') // returns ''root('/foo/bar') // returns '/'
Returns the root of a path, or empty string if not absolute