// A classic App is made out of tons of custom functions
// you can use functions to shorten your coding for repetitive tasks
// When an arrow function has just one argument,
// you can omit the () parentesys
const p = text => document.write(`<p>${text}</p>`)
// Arguments can also have default values!
const h = (text, level = 1 ) =>
document.write(`<h${level}>${text}</h${level}>`)
const image = (url, alt = 'just an image', width = 80) =>
document.write(`<img src="${url}" alt="${alt}" width="${width}" />`)
const link = (url, text, title = 'just a link') =>
document.write(`<a href="${url}" title="${title}">${text}</a>`)
// Now that we have some basic utility functions,
// we can build a nice web page:
h('Marco Pegoraro')
image('https://marcopeg.com/static/ebfc3827d45173658ffff10c869a8321/119a2/marcopeg.jpg', 'Marco Pegoraro')
link('//marcopeg.com', 'Visit my personal blog!')
h('History:', 3)
p('I was born in 1981, it was an hot hot summer...')
p('...')
h('Skills:', 3)
p('html')
p('css')
p('javascript')
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.