// You can wrap many instructions into a function
// and create complex logic.
//
// In the end you can return a value...
const identify = () => {
  const name = prompt('Type your name:')
  const surname = prompt('Type your surname:')
  return `${name} ${surname}`
}

// ... so that later on - when you use that function - things look very easy!
const fullname = identify()
alert(`Your full name is: ${fullname}`)
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.