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