Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function displayNums (n) {
- let html = '<ul>/n'
- for (let i = 0; i <= n; i++) {
- if (i % 2 === 0) {
- let color = 'blue'
- html += ` <li><span style='color:
- ${color}'>${i}</span></li>\n`
- console.log(html)
- } else {
- let color = 'green'
- html += ` <li><span style='color:
- ${color}'>${i}</span></li>\n`
- console.log(html)
- }
- }
- }
- displayNums(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement