JSFiddle - React, Tailwind, and code Playground

by ruhul105

JavaScript

const roles= ['talea','customer']

const path_array = {
'talea':'/tasks',
'customer': '/care-shop'
}

 const fn = () => {
   for(let role of roles) {
    if(role in path_array){
      return path_array[role]
    }
    return 'not-found';
  
  }
 }

console.log('fn', fn())