Skip to content

Instantly share code, notes, and snippets.

@ldong
Created June 21, 2020 07:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ldong/9e1aae696aff2118cb9808dcfd98e713 to your computer and use it in GitHub Desktop.
let horse = {age : 10}

function horseAge(str, age){

    const ageStr = age > 5 ? 'old' : 'young';
    return `${str[0]} ${ageStr} at ${age} years`;
}

horseAge`This hourse is ${horse.age}`
video: https://youtu.be/Mus_vwhTCq0?t=343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment