-
Notifications
You must be signed in to change notification settings - Fork 1
exercise-flip-book #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
done. |
@@ -1,4 +1,10 @@ | |||
/** | |||
* | |||
*/ | |||
export const reverseAndUpper = () => {}; | |||
export const reverseAndUpper = (input) => { | |||
const upperCased = input.toUpperCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run npm run format
to correctly indent the code.
for (const array of arrayOfArrays){ | ||
console.log(array); | ||
const tr = document.createElement('tr'); | ||
for (const element of array){ | ||
console.log(element); | ||
const td = document.createElement('td'); | ||
td.innerText = element ; | ||
tr.appendChild(td); | ||
} | ||
table.appendChild(tr); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we have an arrayOfArrays represeting a table, usually we use names like row
and column
in the for loops.
for (const array of arrayOfArrays){ | |
console.log(array); | |
const tr = document.createElement('tr'); | |
for (const element of array){ | |
console.log(element); | |
const td = document.createElement('td'); | |
td.innerText = element ; | |
tr.appendChild(td); | |
} | |
table.appendChild(tr); | |
} | |
for (const row of arrayOfArrays){ | |
console.log(row); | |
const tr = document.createElement('tr'); | |
for (const column of row){ | |
console.log(column); | |
const td = document.createElement('td'); | |
td.innerText = column ; | |
tr.appendChild(td); | |
} | |
table.appendChild(tr); | |
} |
No description provided.