rbi-learning / Today-I-Learned

1 stars 0 forks source link

7/31 Sara Ho #47

Open saraashleyho opened 4 years ago

saraashleyho commented 4 years ago

Today I Learned

Resume Exercise Takeaways

Step 1 Create an object that houses all your data keys

const data = {
workExperiences: [array]
educationalExperiences: [array]
etc. etc

Step 2 create the render function which will house your HTML


function renderWorkExperience(workExperience) {
  return `[INSERT HTML HERE]

Step 3 Use the document query selector to select the applicable HTML id (or element)

const workExperienceContainer = document.querySelector('#work-experience');

Step 4 Transform your function using the map method:

const eachWorkExperienceHTML = data.workExperiences.map(renderWorkExperience);

Step 5 Join them all together using the join method:

const allWorkExperiencesHTML = eachWorkExperienceHTML.join('');

Step 6 Put everything into HTML using the .innerHTML method.

workExperienceContainer.innerHTML = allWorkExperiencesHTML;

Accessibility