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