CR_MS_Assessment1 CR_MS_Assessment1 CR_MS_Assessment1 The number of attempts remaining is 4 1 / 30 1. Which operator checks both value and data type in JavaScript? a. != b. = = c. = = = d. = 2 / 30 2. What will be the output? setTimeout(() => { console.log("A"); }, 0); console.log("B"); a. A only b. B A c. A B d. B only 3 / 30 3. Which Flexbox property controls whether items move to the next row when space is insufficient? a. flex-wrap b. justify-content c. flex-direction d. align-items 4 / 30 4. Your team notices that search engines are unable to understand the structure of your webpage properly. Which practice would improve this the most? a. Using inline CSS b. Using semantic HTML tags c. Adding more <div> tags d. Using larger fonts 5 / 30 5. What is the output? const user = { name: "Anu" }; const { name } = user; console.log(name); a. user b. Anu c. undefined d. Error 6 / 30 6. Which additional attribute is required with autoplay for video in modern browsers? a. controls b. muted c. loop d. poster 7 / 30 7. What will happen if an element has z-index: 9999 but no positioning applied? a. z-index will not work b. Element disappears c. Always on top d. Becomes fixed 8 / 30 8. Which HTML tag is best suited for displaying tabular data with column headings? a. <table> b. <data> c. <grid> d. <list> 9 / 30 9. Which media query is best suited for targeting mobile devices? a. Mobile and smaller screens b. Large displays only c. Desktop screens only d. Tablets only 10 / 30 10. Which position value keeps an element fixed relative to the browser viewport even during scrolling? a. absolute b. sticky c. fixed d. relative 11 / 30 11. In Flexbox, which property aligns items vertically when flex-direction: row? a. align-items b. align-content c. flex-wrap d. justify-content 12 / 30 12. a. type="submit" b. type="click" c. type="button" d. type="reset" 13 / 30 13. What will be the output? let x = 5; let y = "5"; console.log(x == y); console.log(x === y); a. true false b. true true c. false true d. false false 14 / 30 14. A developer updates the DOM inside a loop thousands of times, causing performance issues in the browser. Which approach would improve performance? a. Use Document Fragment b. Increase delay c. Update each iteration d. Use inline styles 15 / 30 15. A card component should smoothly enlarge slightly when hovered by the user. Which CSS property combination is most appropriate? a. overflow + padding b. float + margin c. transition + transform d. display + position 16 / 30 16. A search API is being called on every keypress in an input field, causing too many API requests. Which technique is most suitable to optimize this? a. Destructuring b. Hoisting c. Recursion d. Debouncing 17 / 30 17. Which attribute improves accessibility by associating a label with an input field? a. name b. placeholder c. for d. id 18 / 30 18. In the CSS Box Model, which property adds space inside the border? a. margin b. outline c. spacing d. padding 19 / 30 19. Which VS Code extension is commonly used to automatically refresh the browser during front-end development? a. Prettier b. Live Server c. IntelliCode d. Code Runner 20 / 30 20. Which CSS unit is generally preferred for scalable and accessible typography? a. vh b. rem c. px d. cm 21 / 30 21. A developer fetches user data from an API using fetch(). Sometimes the API takes time to respond, and the UI freezes while waiting. Which approach is best to handle this situation efficiently? a. Reload page b. console.log() c. Synchronous loops d. async/await or Promises 22 / 30 22. A developer wants to update the text of a paragraph dynamically after a button click. Which combination is required? a. Event handling + DOM Manipulation b. API + Async/Await c. Arrays + Loops d. Objects + Closures 23 / 30 23. Which CSS Grid property is used to define the number and size of columns? a. grid-auto-flow b. grid-template-rows c. grid-template-columns d. grid-column-gap 24 / 30 24. a. Load different images for responsive screens b. Add image animations c. Improve SEO ranking d. Compress image size automatically 25 / 30 25. A sidebar should remain visible after the user scrolls past it, but behave normally before reaching that point. Which CSS position value is most suitable? a. sticky b. absolute c. fixed d. relative 26 / 30 26. Which semantic tag is most appropriate for a standalone blog post on a webpage? a. <aside> b. <section> c. <article> d. <main> 27 / 30 27. Which method is used to add an event listener in modern JavaScript? a. attachEvent() b. eventListener() c. addListener() d. addEventListener() 28 / 30 28. A webpage becomes slow because multiple click events are attached repeatedly inside another event. What is the likely issue? a. Memory leak b. Event bubbling c. Callback hell d. Variable hoisting 29 / 30 29. What will be the output? const numbers = [1, 2, 3, 4]; const result = numbers.map(num => num * 2); console.log(result); a. [1,2,3,4] b. 8 c. [2,4,6,8] d. undefined 30 / 30 30. A form reloads the page automatically when the submit button is clicked, but the developer wants to validate data using JavaScript before submission. Which method should be used? a. stopImmediatePropagation() b. preventDefault() c. removeEventListener() d. stopPropagation() Your score is