pathname

Is '/' necessary in the starting of a pathname?


What is the difference between these two pathnames? Is / necessary to put in start for going in a folder?

assets/myImg.png
/assets/myImg.png

Solution

  • /assets/myImg.png is an absolute path. It means no matter where do you call the path from it's always the same. assets/myImg.png is relative path to your current directory