2024-05-14 스탠다드 미니 과제
import { useState } from "react";import "./App.css";function App() { const initialState = [ { id: 1, name: "John", age: 20 }, { id: 2, name: "Doe", age: 21 }, ]; const [users, setUsers] = useState(initialState); // TODO: 이름과 나이를 각각 상태로 정의하세요. 초기값은 빈문자열("")입니다. const [name, setName] = useState(''); const [age, setAge] = useState(''); // 빈 문자열을 초기값으로 state 값 초기화 // 각각 name, age라는 변수명..
Programing/TIL
2024. 5. 14.
2024-05-13 내배캠 스탠다드 1일차
JS 문법 확인 문제풀이문제 1 (for문)문제다음 문자열 배열에서 stop 문자를 만났을 때 반복을 중지하고, skip 문자를 만났을 때 해당 반복을 건너뛰고 나머지 문자열들을 출력하세요.let words = ['apple', 'banana', 'skip', 'cherry', 'stop', 'date', 'elephant'];풀이// Pseudo Code// 1. words 배열을 순회하면서 stop을 만나면 break;// 2. 순회하면서 skip을 만나면 continue;// 3. [apple, banana, cherry] -> "apple, banana, cherry"let words = ['apple', 'banana', 'skip', 'cherry', 'stop', 'date', 'elepha..
Programing/TIL
2024. 5. 13.