Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import styles from './index.module.scss';
- export const DigitShowView = () => {
- const renderDigits = () => {
- const digits = [];
- for (let i = 1; i <= 100; i++) {
- digits.push(
- <div
- key={i}
- className={`${styles.digit} ${
- i % 2 === 0 ? styles.even : styles.odd
- }`}
- >
- {i}
- </div>
- );
- }
- return digits;
- };
- return <div className={styles.digitDisplay}>{renderDigits()}</div>;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement