JSFiddle - React, Tailwind, and code Playground

JavaScript

const url = '/path/to/something'
const route = {
	url: url,
  title: 'Some random title',
  toString() { return url }
}

// isn't route supposed to be an object
alert(route.toString()) // nope
alert(route.title)