JSFiddle - React, Tailwind, and code Playground

by Mahadevan Sivasubramanian

JavaScript

// function declaration
// function job() 


// function expression

var job = function(job, firstName) {
  switch (job) {
    case 'Designer':
      return firstName + ' will do beautiful website';

    case 'Teacher':
      return firstName + ' will teach classes for kids';

    case 'Developer':
      return firstName + ' will do beautiful website';

    default:
      return firstName + ' Dirty fellow';

  }
}

console.log(job('Designer','Mahadevan'))
console.log(job('Developer','Mahadevan'))
console.log(job('retired','Mahadevan'))