JSFiddle - React, Tailwind, and code Playground

by Felipe Alfaro

JavaScript

const currentPath = 'writers/awards/news-new-work'

function route_same_or_child(url) {
	return currentPath.indexOf(url) === 0
}

alert(route_same_or_child('writers/awards/news-new'))