CR_MS_Assessment2 CR_MS_Assessment2 CR_MS_Assessment2 The number of attempts remaining is 4 1 / 29 What is wrong here? (Coding) 1. Click a. Syntax error b. Nothing happens c. Works fine d. Runs immediately 2 / 29 What will this show? (Coding) const isSunny=true; return 2. {isSunny && 'Sunny Day'} ; a. false b. Error c. Sunny Day d. true 3 / 29 3. What is a callback prop? a. State b. Hook c. API d. Function passed as prop 4 / 29 4. Correct approach : a. setItems([...items,newItem]) b. None c. setItems(items); d. items.push(newItem); 5 / 29 5. What is props drilling? a. API calling b. Passing props deeply through components c. Styling d. Mapping 6 / 29 6. Props are used to a. Fetch API b. Store state c. Style components d. Pass data between components 7 / 29 What will this show? (Coding) const rating = 4.8; return 7. {rating > 4.5 && "Recommended"} ; a. 4.8 b. Error c. Recommended d. Nothing 8 / 29 8. What does this return? (Coding) const [count,setCount]=useState(0); a. Object b. One value c. Two values d. Function 9 / 29 9. What does useEffect do? a. Handle side effects b. Handle props c. Render UI d. Manage state 10 / 29 10. Why are callback props used? a. Child to Parent communication b. API calls c. Routing d. Styling 11 / 29 What will be displayed? (Coding) const name='Rahul'; return 11. {name} ; a. Error b. name c. undefined d. Rahul 12 / 29 12. What is CRUD? a. None b. Copy Remove Update Delete c. Create Read Update Delete d. Create Render Use Delete 13 / 29 13. What does JSX stand for? a. JSON XML b. Java Extension c. Java Syntax Extension d. JavaScript XML 14 / 29 14. What does map() do in React? a. Updates state b. Calls API c. Loops and renders lists d. Styles UI 15 / 29 What will this render? (Coding) function App() { return 15. Hello ; } a. Undefined b. Nothing c. Error d. Hello 16 / 29 16. What is required when rendering lists? a. style b. id c. key prop d. class 17 / 29 17. What is conditional rendering? a. Rendering API b. Rendering hooks c. Rendering CSS d. Rendering based on condition 18 / 29 18. Correct fix: a. setCount(count+2) b. setCount(prev => prev + 1); setCount(prev => prev + 1); c. useEffect d. Reload page 19 / 29 19. What is a React component? a. CSS file b. API c. Reusable UI block d. Database 20 / 29 20. What is useState used for? a. Styling b. State management c. API calls d. Routing 21 / 29 What will this render? (Coding) const items = ["A", "B"]; return items.map((item, i) => 21. {item} ); a. Nothing b. Error c. ['A','B'] d. A B 22 / 29 22. What is wrong here? (Coding) setItems(items.push(newItem)); a. Correct b. Syntax error c. Mutating state d. Missing key 23 / 29 23. What will happen here? (Coding) useEffect(() => { console.log("Hello"); }, []); a. Runs once b. Error c. Runs every render d. Never runs 24 / 29 What will this render? (Coding) const items = []; return 24. {items.length && "Items exist"} ; a. Error b. Items exist c. Nothing 25 / 29 25. Props are a. Arrays only b. Mutable c. Immutable d. Numbers only 26 / 29 26. What will this do? (Coding) setCount(count + 1); setCount(count + 1); a. +1 b. +2 c. Reset d. Error 27 / 29 What will this render? (Coding) const rating = 4.5; return 27. {rating > 4.5 ? "Recommended" : "Normal"} ; a. Nothing b. Recommended c. Normal d. Error 28 / 29 28. Correct fix a. onClick={()=>setCount(count+1)} b. None c. onClick={count+1} d. onClick={setCount(count+1)} 29 / 29 29. Editing a ticket is a. Update b. Delete c. Read d. Create Your score is