728x90 반응형 SMALL 개념/혼자 공부하는 Javascript60 function) apply() 1. **`sample` Function Definition**: - The `sample` function is correctly defined to accept an arbitrary number of arguments using the rest parameter syntax (`...items`). Inside the function, it logs `items`, which would be an array containing all passed arguments. 2. **Attempt to Call `sample` Function**: - The script attempts to call the `sample` function in a peculiar and incorrect manner: `s.. 2025. 1. 28. function) confirm() 1. **`confirm('accept?')`**: This line calls the `confirm` method, which displays a dialog box with a message ('accept?') and two buttons, "OK" and "Cancel". - If the user clicks "OK", `confirm` returns `true`. - If the user clicks "Cancel", `confirm` returns `false`. 2. **`alert(input)`**: This line uses the `alert` method to display another dialog box showing the result of the `confirm` call. .. 2025. 1. 27. function) prompt() 1. **`prompt('message', '_default')`**: This line displays a dialog box to the user with a text input field. - The first argument `'message'` is the text displayed in the dialog box as a message or question to the user. - The second argument `'_default'` specifies the default input value that appears in the text field. The user can either accept this default value, modify it, or enter a complete.. 2025. 1. 26. class) generate object 1. **`createsStudent` Function**: This function is crafted to generate an object for each student, provided with attributes for their name and scores across four subjects (Korean, English, Math, and Science). It returns an object containing: - The student's name and their subject scores as object properties. - A `getSum` method that computes the sum of scores across the four subjects. - A `getAv.. 2025. 1. 25. 이전 1 2 3 4 ··· 15 다음 728x90 반응형 LIST