From 5eb2f9387df4e5ca46c851b3bebfe23cb2805da1 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Fri, 4 Apr 2025 17:45:53 +0800 Subject: [PATCH] [web] i18n: guidebooks, quiz qns, app strings --- apps/web/package.json | 2 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 6 +- .../zh-CN.json | 6 +- .../zh-CN.json | 4 +- .../quiz/describe-event-bubbling/zh-CN.json | 4 +- .../quiz/describe-event-capturing/zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../quiz/explain-event-delegation/zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../quiz/explain-hoisting/zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../en-US.json | 2 +- .../zh-CN.json | 4 +- .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 33 + .../zh-CN.json | 33 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 33 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 33 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 6 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 33 + .../zh-CN.json | 33 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 33 + .../zh-CN.json | 32 + .../zh-CN.json | 33 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 33 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 37 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 37 + .../zh-CN.json | 32 + .../zh-CN.json | 33 + .../zh-CN.json | 6 +- .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 6 +- .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 37 + .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../questions/quiz/list.zh-CN.json | 984 +++++++++--------- .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 31 + .../what-are-server-sent-events/zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 33 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../zh-CN.json | 32 + .../quiz/what-are-symbols-used-for/zh-CN.json | 33 + .../zh-CN.json | 31 + .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 33 + .../zh-CN.json | 31 + .../zh-CN.json | 4 +- .../quiz/what-does-a-doctype-do/zh-CN.json | 4 +- .../zh-CN.json | 6 +- .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 6 +- .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 4 +- .../zh-CN.json | 32 + .../zh-CN.json | 6 +- .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../quiz/what-is-objectfreeze-for/zh-CN.json | 31 + .../zh-CN.json | 31 + .../quiz/what-is-objectseal-for/zh-CN.json | 31 + .../what-is-progressive-rendering/zh-CN.json | 2 +- .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 4 +- .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 33 + .../zh-CN.json | 33 + .../zh-CN.json | 33 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 36 + .../zh-CN.json | 32 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../zh-CN.json | 31 + .../what-is-the-use-of-promiseall/zh-CN.json | 32 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 36 + .../zh-CN.json | 6 +- .../what-is-virtual-dom-in-react/zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 2 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 6 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 36 + .../zh-CN.json | 4 +- .../zh-CN.json | 4 +- .../zh-CN.json | 6 +- .../zh-CN.json | 4 +- .../zh-CN.json | 6 +- apps/web/src/locales/zh-CN.json | 758 +++++++++++++- submodules/front-end-interview-handbook | 2 +- submodules/top-javascript-interview-questions | 2 +- submodules/top-reactjs-interview-questions | 2 +- 290 files changed, 7946 insertions(+), 682 deletions(-) create mode 100644 apps/web/src/__generated__/questions/quiz/describe-event-capturing/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-one-way-data-flow-of-react-and-its-benefits/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-server-side-rendering-of-react-applications-and-its-benefits/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-static-generation-of-react-applications-and-its-benefits/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-composition-pattern-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-a-callback-function-in-asynchronous-operations/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-a-microtask-queue/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-caching-and-how-it-can-be-used-to-improve-performance/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-code-coverage-and-how-it-can-be-used-to-assess-test-quality/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-content-security-policy-csp-and-how-it-enhances-security/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-cross-site-request-forgery-csrf-and-its-mitigation-techniques/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-debouncing-and-throttling/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-destructuring-assignment-for-objects-and-arrays/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-error-propagation-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-hoisting-with-regards-to-functions/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-inheritance-in-es2015-classes/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-input-validation-and-its-importance-in-security/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-lazy-loading-and-how-it-can-improve-performance/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-lexical-scoping/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-partial-application/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-scope-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-tagged-templates/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-test-driven-development-tdd/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-the-prototype-pattern/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-the-singleton-pattern/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-the-spread-operator-and-its-uses/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-the-strategy-pattern/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-the-web-socket-api/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-this-binding-in-event-handlers/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-concept-of-tree-shaking-in-module-bundling/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-difference-between-classical-inheritance-and-prototypal-inheritance/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-difference-between-documentqueryselector-and-documentgetelementbyid/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-difference-between-dot-notation-and-bracket-notation-for-accessing-object-properties/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-difference-between-global-scope-function-scope-and-block-scope/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-difference-between-shallow-copy-and-deep-copy/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-difference-between-unit-testing-integration-testing-and-end-to-end-testing/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-difference-in-hoisting-between-var-let-and-const/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-differences-between-commonjs-modules-and-es-modules/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-different-states-of-a-promise/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-different-ways-the-this-keyword-can-be-bound/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-event-phases-in-a-browser/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-observer-pattern-and-its-use-cases/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-the-presentational-vs-container-component-pattern-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-what-happens-when-setstate-is-called-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/explain-what-react-hydration-is/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-closures-be-used-to-create-private-variables/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-avoid-problems-related-to-hoisting/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-create-custom-error-objects/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-implement-secure-authentication-and-authorization-in-javascript-applications/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-optimize-dom-manipulation-for-better-performance/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-optimize-network-requests-for-better-performance/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-prevent-clickjacking-attacks/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-prevent-sql-injection-vulnerabilities-in-javascript-applications/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-can-you-test-asynchronous-code-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-currying-and-partial-application-differ-from-each-other/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-iframe-on-a-page-communicate/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-sets-and-maps-handle-equality-checks-for-objects/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-abort-a-web-request-using-abortcontrollers/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-access-the-index-of-an-element-in-an-array-during-iteration/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-add-remove-and-modify-html-elements-using-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-add-remove-and-update-elements-in-an-array/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-check-if-an-object-has-a-specific-property/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-check-the-data-type-of-a-variable/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-convert-a-set-to-an-array-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-convert-a-string-to-a-number-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-create-a-constructor-function/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-debug-react-applications/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-decide-between-using-react-state-context-and-external-state-managers/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-detect-if-javascript-is-disabled-on-a-page/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-get-the-query-string-values-of-the-current-page-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-handle-asynchronous-data-loading-in-react-applications/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-handle-errors-in-asynchronous-operations/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-handle-errors-using-trycatch-blocks/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-import-and-export-modules-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-localize-react-applications/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-make-an-http-request-using-the-fetch-api/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-manipulate-css-styles-using-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-prevent-the-default-behavior-of-an-event/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-redirect-to-a-new-page-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-reliably-determine-whether-an-object-is-empty/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-reset-a-components-state-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-test-react-applications/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-use-windowhistory-api/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-validate-form-elements-using-the-constraint-validation-api/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-do-you-write-unit-tests-for-javascript-code/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-does-hoisting-affect-function-declarations-and-expressions/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-does-javascript-garbage-collection-work/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-does-virtual-dom-in-react-work-what-are-its-benefits-and-downsides/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-is-promiseall-different-from-promiseallsettled/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/how-would-one-optimize-the-performance-of-react-contexts-to-reduce-rerenders/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/provide-some-examples-of-how-currying-and-partial-application-can-be-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-callback-functions-and-how-are-they-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-default-parameters-and-how-are-they-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-design-patterns-and-why-are-they-useful/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-error-boundaries-in-react-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-event-listeners-and-how-are-they-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-higher-order-components-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-iterators-and-generators-and-what-are-they-used-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-javascript-object-getters-and-setters-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-javascript-object-property-flags-and-descriptors/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-javascript-polyfills-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-mocks-and-stubs-and-how-are-they-used-in-testing/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-modules-and-why-are-they-useful/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-progressive-web-applications-pwas/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-promises-and-how-do-they-work/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-proxies-in-javascript-used-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-react-fragments-used-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-react-portals-used-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-render-props-in-react-and-what-are-they-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-rest-parameters-and-how-are-they-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-server-sent-events/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-sets-and-maps-and-how-are-they-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-best-practices-for-handling-sensitive-data-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-best-practices-for-writing-maintainable-and-effective-tests/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-common-performance-bottlenecks-in-javascript-applications/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-common-pitfalls-when-doing-data-fetching-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-common-security-headers-and-their-purpose/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-pitfalls-about-using-context-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-popular-javascript-testing-frameworks/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-react-anti-patterns/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-techniques-for-reducing-reflows-and-repaints/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-tools-and-techniques-for-identifying-security-vulnerabilities-in-javascript-code/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-tools-that-can-be-used-for-javascript-testing/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-some-tools-that-can-be-used-to-measure-and-analyze-javascript-performance/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-symbols-used-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-template-literals-and-how-are-they-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-advantages-of-using-the-spread-operator-with-arrays-and-objects/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-benefits-of-using-a-module-bundler/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-benefits-of-using-currying-and-partial-application/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-benefits-of-using-hooks-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-common-pitfalls-of-using-the-this-keyword/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-differences-between-map-set-and-weakmap-weakset/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-differences-between-xmlhttprequest-and-fetch/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-different-methods-for-iterating-over-an-array/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-different-types-of-errors-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-different-types-of-testing-in-software-development/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-different-ways-to-copy-an-object-or-an-array/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-different-ways-to-make-an-api-call-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-metadata-fields-of-a-module/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-potential-issues-caused-by-hoisting/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-potential-pitfalls-of-using-closures/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-rules-of-react-hooks/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-various-data-types-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-the-various-ways-to-create-objects-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-web-workers-and-how-can-they-be-used-to-improve-performance/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-are-workers-in-javascript-used-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-does-re-rendering-mean-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-does-the-dependency-array-of-useeffect-affect/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-asyncawait-and-how-does-it-simplify-asynchronous-code/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-code-splitting-in-a-react-application/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-cross-site-scripting-xss-and-how-can-you-prevent-it/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-currying-and-how-does-it-work/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-forwardref-in-react-used-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-jsx-and-how-does-it-work/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-objectfreeze-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-objectpreventextensions-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-objectseal-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-react-describe-the-benefits-of-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-react-fiber-and-how-is-it-an-improvement-over-the-previous-approach/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-react-strict-mode-and-what-are-its-benefits/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-react-suspense-and-what-does-it-enable/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-reconciliation-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-recursion-and-how-is-it-used-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-command-pattern-and-how-is-it-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-consequence-of-using-array-indices-as-the-value-for-key-s-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-decorator-pattern-and-how-is-it-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-a-map-object-and-a-plain-object-in-javascript/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-a-parameter-and-an-argument/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-controlled-and-uncontrolled-react-components/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-eventpreventdefault-and-eventstoppropagation/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-innerhtml-and-textcontent/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-mouseenter-and-mouseover-event/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-react-node-react-element-and-a-react-component/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-settimeout-setimmediate-and-processnexttick/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-state-and-props-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-the-window-object-and-the-document-object/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-difference-between-useeffect-and-uselayouteffect-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-dom-and-how-is-it-structured/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-factory-pattern-and-how-is-it-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-flux-pattern-and-what-are-its-benefits/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-intl-namespace-object-for/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-module-pattern-and-how-does-it-help-with-encapsulation/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-prototype-chain-and-how-does-it-work/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-purpose-of-callback-function-argument-format-of-setstate-in-react-and-when-should-it-be-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-purpose-of-the-break-and-continue-statements/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-purpose-of-the-finally-block/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-purpose-of-the-key-prop-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-purpose-of-the-new-keyword/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-purpose-of-the-switch-statement/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-spread-operator-and-how-is-it-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-ternary-operator-and-how-is-it-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-use-of-promiseall/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-usecallback-hook-in-react-and-when-should-it-be-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-useid-hook-in-react-and-when-should-it-be-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-usememo-hook-in-react-and-when-should-it-be-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-usereducer-hook-in-react-and-when-should-it-be-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-the-useref-hook-in-react-and-when-should-it-be-used/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/what-is-virtual-dom-in-react/zh-CN.json create mode 100644 apps/web/src/__generated__/questions/quiz/why-does-react-recommend-against-mutating-state/zh-CN.json diff --git a/apps/web/package.json b/apps/web/package.json index bb5bee9c4..e746e69d5 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -15,7 +15,6 @@ "test": "jest", "tsc": "tsc", "transform": "jscodeshift -t ./transforms/transform.ts --parser=tsx", - "translate": "langnostic translate", "db:projects-sync": "ts-node --esm --experimentalSpecifierResolution node ./src/scripts/projects-challenges-sync.ts", "gen": "cross-env NODE_ENV=production tsx ./src/scripts/questions-gen-cli.ts", "gen:watch": "npm run gen:all && NODE_ENV=production tsx ./src/scripts/questions-watcher.ts", @@ -24,6 +23,7 @@ "gen:all": "npm run gen:clean && npm run gen", "gen:clean": "rimraf src/__generated__", "postinstall": "prisma generate", + "i18n": "langnostic translate", "i18n:extract": "formatjs extract \"src/**/*.ts*\" --ignore=\"**/*.d.ts\" --out-file src/locales/en-US.json", "ppp": "ts-node --esm --experimentalSpecifierResolution node ./src/scripts/ppp-update.ts", "screenshot": "ts-node --esm --experimentalSpecifierResolution node ./src/scripts/screenshot.ts", diff --git a/apps/web/src/__generated__/questions/quiz/are-you-familiar-with-styling-svg/zh-CN.json b/apps/web/src/__generated__/questions/quiz/are-you-familiar-with-styling-svg/zh-CN.json index 63171796c..b5141d7dd 100644 --- a/apps/web/src/__generated__/questions/quiz/are-you-familiar-with-styling-svg/zh-CN.json +++ b/apps/web/src/__generated__/questions/quiz/are-you-familiar-with-styling-svg/zh-CN.json @@ -21,11 +21,11 @@ "similarQuestions": [], "slug": "are-you-familiar-with-styling-svg", "subtitle": null, - "title": "您是否熟悉SVG样式?", + "title": "你熟悉 SVG 的样式设置吗?", "topics": [ "css" ], "gitHubEditUrl": "https://github.com/yangshun/front-end-interview-handbook/blob/main/packages/quiz/questions/are-you-familiar-with-styling-svg/zh-CN.mdx" }, - "solution": "var Component=(()=>{var h=Object.create;var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var f=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),g=(n,e)=>{for(var r in e)l(n,r,{get:e[r],enumerable:!0})},s=(n,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let c of m(e))!u.call(n,c)&&c!==r&&l(n,c,{get:()=>e[c],enumerable:!(i=p(e,c))||i.enumerable});return n};var x=(n,e,r)=>(r=n!=null?h(S(n)):{},s(e||!n||!n.__esModule?l(r,\"default\",{value:n,enumerable:!0}):r,n)),b=n=>s(l({},\"__esModule\",{value:!0}),n);var d=f((M,o)=>{o.exports=_jsx_runtime});var y={};g(y,{default:()=>_,frontmatter:()=>C});var t=x(d()),C={title:\"\\u60A8\\u662F\\u5426\\u719F\\u6089SVG\\u6837\\u5F0F\\uFF1F\"};function a(n){let e=Object.assign({p:\"p\",code:\"code\",pre:\"pre\",em:\"em\",a:\"a\"},n.components);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.p,{children:\"\\u6709\\u8FD9\\u4E48\\u51E0\\u79CD\\u65B9\\u6CD5\\u53EF\\u4EE5\\u4E3A\\u5F62\\u72B6\\uFF08Shapes\\uFF09\\u7740\\u8272\\uFF08\\u5305\\u62EC\\u5728\\u5BF9\\u8C61\\u4E0A\\u6307\\u5B9A\\u5C5E\\u6027\\uFF09\\uFF0C\\u4F7F\\u7528\\u5185\\u8054\\u7684 CSS\\u3001\\u5D4C\\u5165\\u7684 CSS \\u90E8\\u5206\\u6216\\u5916\\u90E8 CSS \\u6587\\u4EF6\\u3002 \\u60A8\\u5728\\u7F51\\u9875\\u4E0A\\u627E\\u5230\\u7684\\u5927\\u591A\\u6570 SVG \\u90FD\\u4F7F\\u7528\\u5185\\u8054 CSS\\uFF0C\\u4F46\\u662F\\u6BCF\\u79CD\\u7C7B\\u578B\\u90FD\\u6709\\u4F18\\u52A3\\u4E4B\\u5904\\u3002\"}),`\n`,(0,t.jsxs)(e.p,{children:[\"\\u53EF\\u4EE5\\u901A\\u8FC7\\u5728\\u8282\\u70B9\\u4E0A\\u8BBE\\u7F6E\\u4E24\\u4E2A\\u5C5E\\u6027\\u6765\\u505A\\u57FA\\u672C\\u7740\\u8272\\uFF1A\",(0,t.jsx)(e.code,{children:\"fill\"}),\" \\u548C \",(0,t.jsx)(e.code,{children:\"stroke\"}),\" \\u3002 \",(0,t.jsx)(e.code,{children:\"fill\"}),\"\\u8BBE\\u7F6E\\u5BF9\\u8C61\\u5185\\u7684\\u989C\\u8272\\uFF0C\",(0,t.jsx)(e.code,{children:\"stroke\"}),\"\\u8BBE\\u7F6E\\u5BF9\\u8C61\\u5468\\u56F4\\u7ED8\\u5236\\u7684\\u7EBF\\u7684\\u989C\\u8272\\u3002 \\u4F60\\u53EF\\u4EE5\\u4F7F\\u7528\\u5728 HTML \\u4E2D\\u7684 CSS \\u989C\\u8272\\u547D\\u540D\\u65B9\\u6848\\u5B9A\\u4E49\\u5B83\\u4EEC\\u7684\\u989C\\u8272\\uFF0C\\u6BD4\\u5982\\u8BF4\\u989C\\u8272\\u540D\\uFF08\\u50CF red \\u8FD9\\u79CD\\uFF09\\u3001rgb \\u503C\\uFF08\\u50CF rgb(255,0,0) \\u8FD9\\u79CD\\uFF09\\u3001\\u5341\\u516D\\u8FDB\\u5236\\u503C\\u3001rgba \\u503C\\uFF0C\\u7B49\\u7B49\\u3002\"]}),`\n`,(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:\"language-html\",children:`\n`})}),`\n`,(0,t.jsxs)(e.p,{children:[\"\\u4E0A\\u8FF0\",(0,t.jsx)(e.code,{children:'fill=\"purple\"'}),\"\\u662F\\u4E00\\u4E2A \",(0,t.jsx)(e.em,{children:\"\\u5448\\u73B0\\u5C5E\\u6027\"}),\" \\u7684\\u793A\\u4F8B\\u3002 \\u6709\\u8DA3\\u7684\\u662F\\uFF0C\\u4E0E\\u5185\\u90E8\\u6837\\u5F0F\\u4E0D\\u540C\\u7684\\u662F\\uFF0C\\u50CF\",(0,t.jsx)(e.code,{children:'style=\"fill: purple\"'}),\" (\\u5B83\\u6070\\u5DE7\\u4E5F\\u662F\\u4E00\\u4E2A\\u5C5E\\u6027)\\uFF0C\\u5448\\u73B0\\u5C5E\\u6027\\u53EF\\u4EE5\\u88AB\",(0,t.jsx)(e.a,{href:\"https://css-tricks.com/presentation-attributes-vs-inline-styles/\",children:\"\\u6837\\u5F0F\\u8868\\u4E2D\\u5B9A\\u4E49\\u7684 CSS \\u6837\\u5F0F\"}),\"\\u6240\\u8986\\u76D6\\u3002 \\u56E0\\u6B64\\uFF0C\\u5982\\u679C\\u4F60\\u505A\\u4E86\\u7C7B\\u4F3C\\u4E8E\",(0,t.jsx)(e.code,{children:\"svg { fill: blue; }\"}),\"\\u7684\\u4E8B\\u60C5\\uFF0C\\u5B83\\u5C06\\u8986\\u76D6\\u5DF2\\u5B9A\\u4E49\\u7684\\u7D2B\\u8272\\u586B\\u5145\\u3002\"]})]})}function j(n={}){let{wrapper:e}=n.components||{};return e?(0,t.jsx)(e,Object.assign({},n,{children:(0,t.jsx)(a,n)})):a(n)}var _=j;return b(y);})();\n;return Component;" + "solution": "var Component=(()=>{var a=Object.create;var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var f=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),x=(n,e)=>{for(var r in e)l(n,r,{get:e[r],enumerable:!0})},o=(n,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let c of m(e))!S.call(n,c)&&c!==r&&l(n,c,{get:()=>e[c],enumerable:!(i=p(e,c))||i.enumerable});return n};var g=(n,e,r)=>(r=n!=null?a(u(n)):{},o(e||!n||!n.__esModule?l(r,\"default\",{value:n,enumerable:!0}):r,n)),C=n=>o(l({},\"__esModule\",{value:!0}),n);var d=f((G,s)=>{s.exports=_jsx_runtime});var y={};x(y,{default:()=>b,frontmatter:()=>j});var t=g(d()),j={title:\"\\u4F60\\u719F\\u6089 SVG \\u7684\\u6837\\u5F0F\\u8BBE\\u7F6E\\u5417\\uFF1F\"};function h(n){let e=Object.assign({p:\"p\",code:\"code\",pre:\"pre\",em:\"em\",a:\"a\"},n.components);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.p,{children:\"\\u6709\\u51E0\\u79CD\\u65B9\\u6CD5\\u53EF\\u4EE5\\u4E3A\\u5F62\\u72B6\\u7740\\u8272\\uFF08\\u5305\\u62EC\\u5728\\u5BF9\\u8C61\\u4E0A\\u6307\\u5B9A\\u5C5E\\u6027\\uFF09\\uFF0C\\u53EF\\u4EE5\\u4F7F\\u7528\\u5185\\u8054 CSS\\u3001\\u5D4C\\u5165\\u5F0F CSS \\u90E8\\u5206\\u6216\\u5916\\u90E8 CSS \\u6587\\u4EF6\\u3002 \\u60A8\\u5728\\u7F51\\u7EDC\\u4E0A\\u627E\\u5230\\u7684\\u5927\\u591A\\u6570 SVG \\u90FD\\u4F7F\\u7528\\u5185\\u8054 CSS\\uFF0C\\u4F46\\u6BCF\\u79CD\\u7C7B\\u578B\\u90FD\\u6709\\u5176\\u4F18\\u70B9\\u548C\\u7F3A\\u70B9\\u3002\"}),`\n`,(0,t.jsxs)(e.p,{children:[\"\\u53EF\\u4EE5\\u901A\\u8FC7\\u5728\\u8282\\u70B9\\u4E0A\\u8BBE\\u7F6E\\u4E24\\u4E2A\\u5C5E\\u6027\\u6765\\u5B8C\\u6210\\u57FA\\u672C\\u7740\\u8272\\uFF1A\",(0,t.jsx)(e.code,{children:\"fill\"}),\" \\u548C \",(0,t.jsx)(e.code,{children:\"stroke\"}),\"\\u3002 \",(0,t.jsx)(e.code,{children:\"fill\"}),\" \\u8BBE\\u7F6E\\u5BF9\\u8C61\\u5185\\u90E8\\u7684\\u989C\\u8272\\uFF0C\",(0,t.jsx)(e.code,{children:\"stroke\"}),\" \\u8BBE\\u7F6E\\u7ED8\\u5236\\u5728\\u5BF9\\u8C61\\u5468\\u56F4\\u7684\\u7EBF\\u6761\\u7684\\u989C\\u8272\\u3002 \\u60A8\\u53EF\\u4EE5\\u4F7F\\u7528\\u5728 HTML \\u4E2D\\u4F7F\\u7528\\u7684\\u76F8\\u540C CSS \\u989C\\u8272\\u547D\\u540D\\u65B9\\u6848\\uFF0C\\u65E0\\u8BBA\\u662F\\u989C\\u8272\\u540D\\u79F0\\uFF08\\u5373 \",(0,t.jsx)(e.code,{children:\"red\"}),\"\\uFF09\\u3001RGB \\u503C\\uFF08\\u5373 \",(0,t.jsx)(e.code,{children:\"rgb(255,0,0)\"}),\"\\uFF09\\u3001\\u5341\\u516D\\u8FDB\\u5236\\u503C\\u3001RGBA \\u503C\\u7B49\\u3002\"]}),`\n`,(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:\"language-html\",children:`\n`})}),`\n`,(0,t.jsxs)(e.p,{children:[\"\\u4E0A\\u9762\\u7684 \",(0,t.jsx)(e.code,{children:'fill=\"purple\"'}),\" \\u662F\",(0,t.jsx)(e.em,{children:\"\\u8868\\u73B0\\u5C5E\\u6027\"}),\"\\u7684\\u4E00\\u4E2A\\u4F8B\\u5B50\\u3002 \\u6709\\u8DA3\\u7684\\u662F\\uFF0C\\u4E0E \",(0,t.jsx)(e.code,{children:'style=\"fill: purple\"'}),\" \\u8FD9\\u6837\\u7684\\u5185\\u8054\\u6837\\u5F0F\\uFF08\\u5B83\\u4E5F\\u6070\\u597D\\u662F\\u4E00\\u4E2A\\u5C5E\\u6027\\uFF09\\u4E0D\\u540C\\uFF0C\\u8868\\u73B0\\u5C5E\\u6027\\u53EF\\u4EE5\\u88AB\\u6837\\u5F0F\\u8868\\u4E2D\\u5B9A\\u4E49\\u7684 \",(0,t.jsx)(e.a,{href:\"https://css-tricks.com/presentation-attributes-vs-inline-styles/\",children:\"CSS \\u6837\\u5F0F\\u8986\\u76D6\"}),\"\\u3002 \\u56E0\\u6B64\\uFF0C\\u5982\\u679C\\u60A8\\u6267\\u884C\\u7C7B\\u4F3C \",(0,t.jsx)(e.code,{children:\"svg { fill: blue; }\"}),\" \\u7684\\u64CD\\u4F5C\\uFF0C\\u5B83\\u5C06\\u8986\\u76D6\\u5DF2\\u5B9A\\u4E49\\u7684\\u7D2B\\u8272\\u586B\\u5145\\u3002\"]})]})}function _(n={}){let{wrapper:e}=n.components||{};return e?(0,t.jsx)(e,Object.assign({},n,{children:(0,t.jsx)(h,n)})):h(n)}var b=_;return C(y);})();\n;return Component;" } \ No newline at end of file diff --git a/apps/web/src/__generated__/questions/quiz/can-you-explain-the-difference-between-coding-a-website-to-be-responsive-versus-using-a-mobile-first-strategy/zh-CN.json b/apps/web/src/__generated__/questions/quiz/can-you-explain-the-difference-between-coding-a-website-to-be-responsive-versus-using-a-mobile-first-strategy/zh-CN.json index f633005a4..bfae4d01e 100644 --- a/apps/web/src/__generated__/questions/quiz/can-you-explain-the-difference-between-coding-a-website-to-be-responsive-versus-using-a-mobile-first-strategy/zh-CN.json +++ b/apps/web/src/__generated__/questions/quiz/can-you-explain-the-difference-between-coding-a-website-to-be-responsive-versus-using-a-mobile-first-strategy/zh-CN.json @@ -21,11 +21,11 @@ "similarQuestions": [], "slug": "can-you-explain-the-difference-between-coding-a-website-to-be-responsive-versus-using-a-mobile-first-strategy", "subtitle": null, - "title": "你能解释一下将网站编码为响应式与使用移动优先策略之间的区别吗?", + "title": "你能解释一下编写响应式网站与使用移动优先策略的区别吗?", "topics": [ "css" ], "gitHubEditUrl": "https://github.com/yangshun/front-end-interview-handbook/blob/main/packages/quiz/questions/can-you-explain-the-difference-between-coding-a-website-to-be-responsive-versus-using-a-mobile-first-strategy/zh-CN.mdx" }, - "solution": "var Component=(()=>{var m=Object.create;var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var f=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),g=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},l=(e,n,t,r)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let c of x(n))!u.call(e,c)&&c!==t&&i(e,c,{get:()=>n[c],enumerable:!(r=p(n,c))||r.enumerable});return e};var j=(e,n,t)=>(t=e!=null?m(h(e)):{},l(n||!e||!e.__esModule?i(t,\"default\",{value:e,enumerable:!0}):t,e)),_=e=>l(i({},\"__esModule\",{value:!0}),e);var o=f((b,a)=>{a.exports=_jsx_runtime});var C={};g(C,{default:()=>z,frontmatter:()=>y});var s=j(o()),y={title:\"\\u4F60\\u80FD\\u89E3\\u91CA\\u4E00\\u4E0B\\u5C06\\u7F51\\u7AD9\\u7F16\\u7801\\u4E3A\\u54CD\\u5E94\\u5F0F\\u4E0E\\u4F7F\\u7528\\u79FB\\u52A8\\u4F18\\u5148\\u7B56\\u7565\\u4E4B\\u95F4\\u7684\\u533A\\u522B\\u5417\\uFF1F\"};function d(e){let n=Object.assign({p:\"p\",pre:\"pre\",code:\"code\",ul:\"ul\",li:\"li\"},e.components);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:\"\\u8FD9\\u4E24\\u79CD\\u529E\\u6CD5\\u5E76\\u975E\\u76F8\\u4E92\\u6392\\u65A5\\u3002 \\u7F51\\u7AD9\\u54CD\\u5E94\\u610F\\u5473\\u7740\\u67D0\\u4E9B\\u5143\\u7D20\\u5C06\\u6839\\u636E\\u8BBE\\u5907\\u7684\\u5C4F\\u5E55\\u5927\\u5C0F\\u901A\\u8FC7\\u8C03\\u6574\\u5176\\u5927\\u5C0F\\u6216\\u5176\\u4ED6\\u529F\\u80FD\\u6765\\u5E94\\u5BF9\\u3002 \\u901A\\u5E38\\u662F\\u89C6\\u56FE\\u5BBD\\u5EA6\\uFF0C\\u901A\\u8FC7 CSS \\u5A92\\u4F53\\u67E5\\u8BE2\\uFF0C\\u4F8B\\u5982\\uFF0C\\u5728\\u8F83\\u5C0F\\u7684\\u8BBE\\u5907\\u4E0A\\u4F7F\\u5B57\\u4F53\\u5927\\u5C0F\\u66F4\\u5C0F\\u3002\"}),`\n`,(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:\"language-css\",children:`@media (min-width: 768px) {\n .my-class {\n font-size: 24px;\n }\n}\n\n@media (max-width: 767px) {\n .my-class {\n font-size: 12px;\n }\n}\n`})}),`\n`,(0,s.jsx)(n.p,{children:\"\\u79FB\\u52A8\\u4F18\\u5148\\u7684\\u7B56\\u7565\\u4E5F\\u662F\\u54CD\\u5E94\\u5F0F\\u7684\\uFF0C\\u4F46\\u5B83\\u5141\\u8BB8\\u6211\\u4EEC\\u5E94\\u8BE5\\u9ED8\\u8BA4\\u548C\\u5B9A\\u4E49\\u79FB\\u52A8\\u8BBE\\u5907\\u7684\\u6240\\u6709\\u6837\\u5F0F\\uFF0C\\u53EA\\u5728\\u4EE5\\u540E\\u4E3A\\u5176\\u4ED6\\u8BBE\\u5907\\u6DFB\\u52A0\\u7279\\u5B9A\\u7684\\u54CD\\u5E94\\u5F0F\\u89C4\\u5219\\u3002 \\u6CBF\\u7528\\u4E0A\\u4E00\\u4E2A\\u793A\\u4F8B\\uFF1A\"}),`\n`,(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:\"language-css\",children:`.my-class {\n font-size: 12px;\n}\n\n@media (min-width: 768px) {\n .my-class {\n font-size: 24px;\n }\n}\n`})}),`\n`,(0,s.jsx)(n.p,{children:\"\\u79FB\\u52A8\\u4F18\\u5148\\u7B56\\u7565\\u5177\\u6709\\u4EE5\\u4E0B\\u4E3B\\u8981\\u4F18\\u70B9\\uFF1A\"}),`\n`,(0,s.jsxs)(n.ul,{children:[`\n`,(0,s.jsx)(n.li,{children:\"\\u5B83\\u5728\\u79FB\\u52A8\\u8BBE\\u5907\\u4E0A\\u7684\\u6027\\u80FD\\u66F4\\u5F3A\\uFF0C\\u56E0\\u4E3A\\u9002\\u7528\\u4E8E\\u5B83\\u4EEC\\u7684\\u6240\\u6709\\u89C4\\u5219\\u90FD\\u4E0D\\u5FC5\\u4E0E\\u4EFB\\u4F55\\u5A92\\u4F53\\u67E5\\u8BE2\\u8FDB\\u884C\\u9A8C\\u8BC1\\u3002\"}),`\n`,(0,s.jsx)(n.li,{children:\"\\u79FB\\u52A8\\u4F18\\u5148\\u7684\\u8BBE\\u8BA1\\u66F4\\u6709\\u53EF\\u80FD\\u5728\\u66F4\\u5927\\u7684\\u8BBE\\u5907\\u4E0A\\u4F7F\\u7528\\uFF08\\u53EA\\u662F\\u4F1A\\u663E\\u5F97\\u66F4\\u62C9\\u957F\\uFF0C\\u4F46\\u4ECD\\u7136\\u53EF\\u4EE5\\u4F7F\\u7528\\uFF09\\u3002 \\u5F53\\u7136\\uFF0C\\u53CD\\u8FC7\\u6765\\u5C31\\u4E0D\\u9002\\u7528\\u4E86\\u3002\"}),`\n`]})]})}function w(e={}){let{wrapper:n}=e.components||{};return n?(0,s.jsx)(n,Object.assign({},e,{children:(0,s.jsx)(d,e)})):d(e)}var z=w;return _(C);})();\n;return Component;" + "solution": "var Component=(()=>{var m=Object.create;var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var f=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),g=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},l=(e,n,t,r)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let c of x(n))!u.call(e,c)&&c!==t&&i(e,c,{get:()=>n[c],enumerable:!(r=p(n,c))||r.enumerable});return e};var j=(e,n,t)=>(t=e!=null?m(h(e)):{},l(n||!e||!e.__esModule?i(t,\"default\",{value:e,enumerable:!0}):t,e)),_=e=>l(i({},\"__esModule\",{value:!0}),e);var o=f((b,a)=>{a.exports=_jsx_runtime});var C={};g(C,{default:()=>z,frontmatter:()=>y});var s=j(o()),y={title:\"\\u4F60\\u80FD\\u89E3\\u91CA\\u4E00\\u4E0B\\u7F16\\u5199\\u54CD\\u5E94\\u5F0F\\u7F51\\u7AD9\\u4E0E\\u4F7F\\u7528\\u79FB\\u52A8\\u4F18\\u5148\\u7B56\\u7565\\u7684\\u533A\\u522B\\u5417\\uFF1F\"};function d(e){let n=Object.assign({p:\"p\",pre:\"pre\",code:\"code\",ul:\"ul\",li:\"li\"},e.components);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:\"\\u8FD9\\u4E24\\u79CD\\u65B9\\u6CD5\\u5E76\\u975E\\u76F8\\u4E92\\u6392\\u65A5\\u3002\\u4F7F\\u7F51\\u7AD9\\u5177\\u6709\\u54CD\\u5E94\\u6027\\u610F\\u5473\\u7740\\u67D0\\u4E9B\\u5143\\u7D20\\u5C06\\u901A\\u8FC7\\u8C03\\u6574\\u5176\\u5927\\u5C0F\\u6216\\u5176\\u4ED6\\u529F\\u80FD\\u6765\\u54CD\\u5E94\\uFF0C\\u5177\\u4F53\\u53D6\\u51B3\\u4E8E\\u8BBE\\u5907\\u7684\\u5C4F\\u5E55\\u5C3A\\u5BF8\\uFF0C\\u901A\\u5E38\\u662F\\u89C6\\u53E3\\u5BBD\\u5EA6\\uFF0C\\u4F8B\\u5982\\u901A\\u8FC7 CSS \\u5A92\\u4F53\\u67E5\\u8BE2\\uFF0C\\u4F8B\\u5982\\uFF0C\\u5728\\u8F83\\u5C0F\\u7684\\u8BBE\\u5907\\u4E0A\\u51CF\\u5C0F\\u5B57\\u4F53\\u5927\\u5C0F\\u3002\"}),`\n`,(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:\"language-css\",children:`@media (min-width: 768px) {\n .my-class {\n font-size: 24px;\n }\n}\n\n@media (max-width: 767px) {\n .my-class {\n font-size: 12px;\n }\n}\n`})}),`\n`,(0,s.jsx)(n.p,{children:\"\\u79FB\\u52A8\\u4F18\\u5148\\u7B56\\u7565\\u4E5F\\u5177\\u6709\\u54CD\\u5E94\\u6027\\uFF0C\\u4F46\\u662F\\u5B83\\u540C\\u610F\\u6211\\u4EEC\\u5E94\\u8BE5\\u4E3A\\u79FB\\u52A8\\u8BBE\\u5907\\u8BBE\\u7F6E\\u9ED8\\u8BA4\\u503C\\u5E76\\u5B9A\\u4E49\\u6240\\u6709\\u6837\\u5F0F\\uFF0C\\u5E76\\u4E14\\u7A0D\\u540E\\u4EC5\\u4E3A\\u5176\\u4ED6\\u8BBE\\u5907\\u6DFB\\u52A0\\u7279\\u5B9A\\u7684\\u54CD\\u5E94\\u5F0F\\u89C4\\u5219\\u3002 \\u9075\\u5FAA\\u524D\\u9762\\u7684\\u793A\\u4F8B\\uFF1A\"}),`\n`,(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:\"language-css\",children:`.my-class {\n font-size: 12px;\n}\n\n@media (min-width: 768px) {\n .my-class {\n font-size: 24px;\n }\n}\n`})}),`\n`,(0,s.jsx)(n.p,{children:\"\\u79FB\\u52A8\\u4F18\\u5148\\u7B56\\u7565\\u5177\\u6709\\u4EE5\\u4E0B\\u4E3B\\u8981\\u4F18\\u70B9\\uFF1A\"}),`\n`,(0,s.jsxs)(n.ul,{children:[`\n`,(0,s.jsx)(n.li,{children:\"\\u5B83\\u5728\\u79FB\\u52A8\\u8BBE\\u5907\\u4E0A\\u5177\\u6709\\u66F4\\u9AD8\\u7684\\u6027\\u80FD\\uFF0C\\u56E0\\u4E3A\\u5E94\\u7528\\u4E8E\\u5B83\\u4EEC\\u7684\\u89C4\\u5219\\u4E0D\\u5FC5\\u9488\\u5BF9\\u4EFB\\u4F55\\u5A92\\u4F53\\u67E5\\u8BE2\\u8FDB\\u884C\\u9A8C\\u8BC1\\u3002\"}),`\n`,(0,s.jsx)(n.li,{children:\"\\u79FB\\u52A8\\u4F18\\u5148\\u8BBE\\u8BA1\\u66F4\\u6709\\u53EF\\u80FD\\u5728\\u66F4\\u5927\\u7684\\u8BBE\\u5907\\u4E0A\\u4F7F\\u7528\\uFF08\\u53EA\\u4F1A\\u663E\\u5F97\\u66F4\\u62C9\\u4F38\\uFF0C\\u4F46\\u4ECD\\u7136\\u53EF\\u7528\\uFF09\\u3002 \\u4F46\\u662F\\uFF0C\\u53CD\\u4E4B\\u5219\\u4E0D\\u7136\\u3002\"}),`\n`]})]})}function w(e={}){let{wrapper:n}=e.components||{};return n?(0,s.jsx)(n,Object.assign({},e,{children:(0,s.jsx)(d,e)})):d(e)}var z=w;return _(C);})();\n;return Component;" } \ No newline at end of file diff --git a/apps/web/src/__generated__/questions/quiz/can-you-give-an-example-of-an-media-property-other-than-screen/zh-CN.json b/apps/web/src/__generated__/questions/quiz/can-you-give-an-example-of-an-media-property-other-than-screen/zh-CN.json index 6b94e8cd6..ea68a63ac 100644 --- a/apps/web/src/__generated__/questions/quiz/can-you-give-an-example-of-an-media-property-other-than-screen/zh-CN.json +++ b/apps/web/src/__generated__/questions/quiz/can-you-give-an-example-of-an-media-property-other-than-screen/zh-CN.json @@ -21,11 +21,11 @@ "similarQuestions": [], "slug": "can-you-give-an-example-of-an-media-property-other-than-screen", "subtitle": null, - "title": "你能举例说明除 \"screen \"以外的媒体查询属性吗?", + "title": "你能举一个除了`screen`之外的`@media`属性的例子吗?", "topics": [ "css" ], "gitHubEditUrl": "https://github.com/yangshun/front-end-interview-handbook/blob/main/packages/quiz/questions/can-you-give-an-example-of-an-media-property-other-than-screen/zh-CN.mdx" }, - "solution": "var Component=(()=>{var h=Object.create;var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var j=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),_=(e,n)=>{for(var r in n)l(e,r,{get:n[r],enumerable:!0})},d=(e,n,r,t)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let i of m(n))!x.call(e,i)&&i!==r&&l(e,i,{get:()=>n[i],enumerable:!(t=p(n,i))||t.enumerable});return e};var g=(e,n,r)=>(r=e!=null?h(u(e)):{},d(n||!e||!e.__esModule?l(r,\"default\",{value:e,enumerable:!0}):r,e)),f=e=>d(l({},\"__esModule\",{value:!0}),e);var s=j((F,o)=>{o.exports=_jsx_runtime});var C={};_(C,{default:()=>y,frontmatter:()=>b});var c=g(s()),b={title:'\\u4F60\\u80FD\\u4E3E\\u4F8B\\u8BF4\\u660E\\u9664 \"screen \"\\u4EE5\\u5916\\u7684\\u5A92\\u4F53\\u67E5\\u8BE2\\u5C5E\\u6027\\u5417\\uFF1F'};function a(e){let n=Object.assign({p:\"p\",code:\"code\",ul:\"ul\",li:\"li\",pre:\"pre\"},e.components);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(n.p,{children:[\"\\u6709\\u56DB\\u79CD\\u7C7B\\u578B\\u7684\\u5A92\\u4F53\\u67E5\\u8BE2\\u5C5E\\u6027(\\u5305\\u62EC\",(0,c.jsx)(n.code,{children:\"screen\"}),\")\\uFF1A\"]}),`\n`,(0,c.jsxs)(n.ul,{children:[`\n`,(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:\"all\"}),\"\\uFF1A\\u9002\\u7528\\u4E8E\\u6240\\u6709\\u5A92\\u4F53\\u7C7B\\u578B\\u8BBE\\u5907\"]}),`\n`,(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:\"print\"}),\": \\u9002\\u7528\\u4E8E\\u6253\\u5370\\u673A\"]}),`\n`,(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:\"speech\"}),'\\uFF1A\\u7528\\u4E8E\\u5C4F\\u5E55\\u9605\\u8BFB\\u5668\\uFF0C\\u5927\\u58F0 \"\\u8BFB \"\\u51FA\\u9875\\u9762\\u3002']}),`\n`,(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:\"screen\"}),\"\\uFF1A\\u7528\\u4E8E\\u7535\\u8111\\u5C4F\\u5E55\\u3001\\u5E73\\u677F\\u7535\\u8111\\u3001\\u667A\\u80FD\\u624B\\u673A\\u7B49\\u3002\"]}),`\n`]}),`\n`,(0,c.jsxs)(n.p,{children:[\"\\u4E0B\\u9762\\u662F \",(0,c.jsx)(n.code,{children:\"print\"}),\" \\u5A92\\u4F53\\u7C7B\\u578B\\u7684\\u7528\\u6CD5\\u793A\\u4F8B\\uFF1A\"]}),`\n`,(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:\"language-css\",children:`@media print {\n body {\n color: black;\n }\n}\n`})})]})}function M(e={}){let{wrapper:n}=e.components||{};return n?(0,c.jsx)(n,Object.assign({},e,{children:(0,c.jsx)(a,e)})):a(e)}var y=M;return f(C);})();\n;return Component;" + "solution": "var Component=(()=>{var h=Object.create;var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),_=(n,e)=>{for(var r in e)l(n,r,{get:e[r],enumerable:!0})},t=(n,e,r,d)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let i of m(e))!x.call(n,i)&&i!==r&&l(n,i,{get:()=>e[i],enumerable:!(d=p(e,i))||d.enumerable});return n};var g=(n,e,r)=>(r=n!=null?h(u(n)):{},t(e||!n||!n.__esModule?l(r,\"default\",{value:n,enumerable:!0}):r,n)),f=n=>t(l({},\"__esModule\",{value:!0}),n);var s=j((F,o)=>{o.exports=_jsx_runtime});var C={};_(C,{default:()=>y,frontmatter:()=>b});var c=g(s()),b={title:\"\\u4F60\\u80FD\\u4E3E\\u4E00\\u4E2A\\u9664\\u4E86`screen`\\u4E4B\\u5916\\u7684`@media`\\u5C5E\\u6027\\u7684\\u4F8B\\u5B50\\u5417\\uFF1F\"};function a(n){let e=Object.assign({p:\"p\",code:\"code\",ul:\"ul\",li:\"li\",pre:\"pre\"},n.components);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(e.p,{children:[\"\\u6709\\u56DB\\u79CD\\u7C7B\\u578B\\u7684\",(0,c.jsx)(e.code,{children:\"@media\"}),\"\\u5C5E\\u6027\\uFF08\\u5305\\u62EC\",(0,c.jsx)(e.code,{children:\"screen\"}),\"\\uFF09\\uFF1A\"]}),`\n`,(0,c.jsxs)(e.ul,{children:[`\n`,(0,c.jsxs)(e.li,{children:[(0,c.jsx)(e.code,{children:\"all\"}),\"\\uFF1A\\u9002\\u7528\\u4E8E\\u6240\\u6709\\u5A92\\u4F53\\u7C7B\\u578B\\u8BBE\\u5907\"]}),`\n`,(0,c.jsxs)(e.li,{children:[(0,c.jsx)(e.code,{children:\"print\"}),\"\\uFF1A\\u9002\\u7528\\u4E8E\\u6253\\u5370\\u673A\"]}),`\n`,(0,c.jsxs)(e.li,{children:[(0,c.jsx)(e.code,{children:\"speech\"}),\"\\uFF1A\\u9002\\u7528\\u4E8E\\u201C\\u6717\\u8BFB\\u201D\\u9875\\u9762\\u7684\\u5C4F\\u5E55\\u9605\\u8BFB\\u5668\"]}),`\n`,(0,c.jsxs)(e.li,{children:[(0,c.jsx)(e.code,{children:\"screen\"}),\"\\uFF1A\\u9002\\u7528\\u4E8E\\u7535\\u8111\\u5C4F\\u5E55\\u3001\\u5E73\\u677F\\u7535\\u8111\\u3001\\u667A\\u80FD\\u624B\\u673A\\u7B49\\u3002\"]}),`\n`]}),`\n`,(0,c.jsxs)(e.p,{children:[\"\\u4EE5\\u4E0B\\u662F\",(0,c.jsx)(e.code,{children:\"print\"}),\"\\u5A92\\u4F53\\u7C7B\\u578B\\u7528\\u6CD5\\u7684\\u793A\\u4F8B\\uFF1A\"]}),`\n`,(0,c.jsx)(e.pre,{children:(0,c.jsx)(e.code,{className:\"language-css\",children:`@media print {\n body {\n color: black;\n }\n}\n`})})]})}function M(n={}){let{wrapper:e}=n.components||{};return e?(0,c.jsx)(e,Object.assign({},n,{children:(0,c.jsx)(a,n)})):a(n)}var y=M;return f(C);})();\n;return Component;" } \ No newline at end of file diff --git a/apps/web/src/__generated__/questions/quiz/can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions/zh-CN.json b/apps/web/src/__generated__/questions/quiz/can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions/zh-CN.json index 286160e4b..75e3d3291 100644 --- a/apps/web/src/__generated__/questions/quiz/can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions/zh-CN.json +++ b/apps/web/src/__generated__/questions/quiz/can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions/zh-CN.json @@ -20,12 +20,12 @@ "ranking": 999, "similarQuestions": [], "slug": "can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions", - "subtitle": "这个新语法与其他函数有什么不同?", - "title": "您可以为新箭头函数语法提供一个用例吗?", + "subtitle": "这种新语法与其他函数有何不同?", + "title": "箭头 => 函数语法有什么用例?", "topics": [ "javascript" ], "gitHubEditUrl": "https://github.com/yangshun/top-javascript-interview-questions/blob/main/questions/can-you-offer-a-use-case-for-the-new-arrow-function-syntax-how-does-this-new-syntax-differ-from-other-functions/zh-CN.mdx" }, - "solution": "var Component=(()=>{var u=Object.create;var l=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var b=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports),f=(r,n)=>{for(var c in n)l(r,c,{get:n[c],enumerable:!0})},t=(r,n,c,d)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let i of m(n))!p.call(r,i)&&i!==c&&l(r,i,{get:()=>n[i],enumerable:!(d=a(n,i))||d.enumerable});return r};var j=(r,n,c)=>(c=r!=null?u(g(r)):{},t(n||!r||!r.__esModule?l(c,\"default\",{value:r,enumerable:!0}):c,r)),x=r=>t(l({},\"__esModule\",{value:!0}),r);var o=b((C,h)=>{h.exports=_jsx_runtime});var M={};f(M,{default:()=>S,frontmatter:()=>_});var e=j(o()),_={title:\"\\u60A8\\u53EF\\u4EE5\\u4E3A\\u65B0\\u7BAD\\u5934\\u51FD\\u6570\\u8BED\\u6CD5\\u63D0\\u4F9B\\u4E00\\u4E2A\\u7528\\u4F8B\\u5417\\uFF1F\",subtitle:\"\\u8FD9\\u4E2A\\u65B0\\u8BED\\u6CD5\\u4E0E\\u5176\\u4ED6\\u51FD\\u6570\\u6709\\u4EC0\\u4E48\\u4E0D\\u540C\\uFF1F\"};function s(r){let n=Object.assign({p:\"p\",code:\"code\",h2:\"h2\",h3:\"h3\",pre:\"pre\",ol:\"ol\",li:\"li\",strong:\"strong\",ul:\"ul\"},r.components);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(n.p,{children:[(0,e.jsx)(n.code,{children:\"=>\"}),' \\u51FD\\u6570\\u8BED\\u6CD5\\uFF0C\\u4E5F\\u88AB\\u79F0\\u4E3A \"\\u7BAD\\u5934\\u51FD\\u6570\"\\uFF0C\\u662F\\u5728 ECMAScript 6\\uFF08ES6\\uFF09\\u4E2D\\u5F15\\u5165\\u7684 JavaScript \\u529F\\u80FD\\u3002\\u5B83\\u63D0\\u4F9B\\u4E86\\u4E00\\u79CD\\u66F4\\u7B80\\u6D01\\u7684\\u7F16\\u5199\\u51FD\\u6570\\u7684\\u65B9\\u5F0F\\uFF0C\\u5E76\\u4E14\\u5728 ',(0,e.jsx)(n.code,{children:\"this\"}),\" \\u7684\\u884C\\u4E3A\\u65B9\\u9762\\u4E0E\\u4F20\\u7EDF\\u51FD\\u6570\\u8868\\u8FBE\\u5F0F\\u6709\\u4E00\\u4E9B\\u4E0D\\u540C\\u3002\\u4E0B\\u9762\\u901A\\u8FC7\\u4E00\\u4E2A\\u7B80\\u5355\\u7684\\u7528\\u4F8B\\u6765\\u8BF4\\u660E\\u5B83\\u7684\\u5B9E\\u7528\\u6027\\uFF1A\"]}),`\n`,(0,e.jsx)(n.h2,{children:\"\\u7528\\u4F8B\\uFF1A\\u7B5B\\u9009\\u6570\\u7EC4\"}),`\n`,(0,e.jsx)(n.p,{children:\"\\u5047\\u8BBE\\u4F60\\u6709\\u4E00\\u4E2A\\u5305\\u542B\\u6570\\u5B57\\u7684\\u6570\\u7EC4\\uFF0C\\u4F60\\u60F3\\u7B5B\\u9009\\u51FA\\u6240\\u6709\\u5C0F\\u4E8E 10 \\u7684\\u6570\\u5B57\\u3002\\u4F60\\u53EF\\u4EE5\\u4F7F\\u7528\\u4F20\\u7EDF\\u7684\\u51FD\\u6570\\u8BED\\u6CD5\\u548C\\u65B0\\u7684\\u7BAD\\u5934\\u51FD\\u6570\\u8BED\\u6CD5\\u6765\\u5B9E\\u73B0\\u8FD9\\u4E00\\u76EE\\u6807\\uFF0C\\u5982\\u4E0B\\u6240\\u793A\\uFF1A\"}),`\n`,(0,e.jsx)(n.h3,{children:\"\\u4F20\\u7EDF\\u51FD\\u6570\\u8BED\\u6CD5\"}),`\n`,(0,e.jsx)(n.pre,{children:(0,e.jsx)(n.code,{className:\"language-js\",children:`const numbers = [1, 5, 10, 15, 20];\nconst filteredNumbers = numbers.filter(function (number) {\n return number >= 10;\n});\n\nconsole.log(filteredNumbers); // \\u8F93\\u51FA: [10, 15, 20]\n`})}),`\n`,(0,e.jsx)(n.h3,{children:\"\\u7BAD\\u5934\\u51FD\\u6570\\u8BED\\u6CD5\"}),`\n`,(0,e.jsx)(n.pre,{children:(0,e.jsx)(n.code,{className:\"language-js\",children:`const numbers = [1, 5, 10, 15, 20];\nconst filteredNumbers = numbers.filter((number) => number >= 10);\n\nconsole.log(filteredNumbers); // \\u8F93\\u51FA: [10, 15, 20]\n`})}),`\n`,(0,e.jsx)(n.h2,{children:\"\\u7BAD\\u5934\\u51FD\\u6570\\u7684\\u4F18\\u70B9\"}),`\n`,(0,e.jsxs)(n.ol,{children:[`\n`,(0,e.jsxs)(n.li,{children:[(0,e.jsx)(n.strong,{children:\"\\u7B80\\u6D01\\u6027\"}),\"\\uFF1A\\u7BAD\\u5934\\u51FD\\u6570\\u66F4\\u52A0\\u7B80\\u6D01\\uFF0C\\u4F7F\\u4F60\\u7684\\u4EE3\\u7801\\u66F4\\u77ED\\u4E14\\u6613\\u4E8E\\u9605\\u8BFB\\u3002\"]}),`\n`,(0,e.jsxs)(n.li,{children:[(0,e.jsxs)(n.strong,{children:[(0,e.jsx)(n.code,{children:\"this\"}),\" \\u884C\\u4E3A\"]}),\"\\uFF1A\\u7BAD\\u5934\\u51FD\\u6570\\u6CA1\\u6709\\u81EA\\u5DF1\\u7684 \",(0,e.jsx)(n.code,{children:\"this\"}),\"\\u3002\\u76F8\\u53CD\\uFF0C\\u5B83\\u4EEC\\u7EE7\\u627F\\u81EA\\u5B83\\u4EEC\\u5728\\u5B9A\\u4E49\\u65F6\\u7684\\u7236\\u7EA7\\u4F5C\\u7528\\u57DF\\u4E2D\\u7684 \",(0,e.jsx)(n.code,{children:\"this\"}),\"\\u3002\\u8FD9\\u5728\\u5904\\u7406\\u56DE\\u8C03\\u5E76\\u5E0C\\u671B\\u4FDD\\u7559 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u4E0A\\u4E0B\\u6587\\u7684\\u60C5\\u51B5\\u4E0B\\u7279\\u522B\\u6709\\u7528\\u3002\"]}),`\n`,(0,e.jsxs)(n.li,{children:[(0,e.jsx)(n.strong,{children:\"\\u9690\\u5F0F\\u8FD4\\u56DE\"}),\"\\uFF1A\\u5982\\u679C\\u51FD\\u6570\\u4F53\\u53EA\\u5305\\u542B\\u4E00\\u4E2A\\u8868\\u8FBE\\u5F0F\\uFF0C\\u7BAD\\u5934\\u51FD\\u6570\\u5141\\u8BB8\\u7701\\u7565 \",(0,e.jsx)(n.code,{children:\"return\"}),\" \\u5173\\u952E\\u5B57\\u548C\\u82B1\\u62EC\\u53F7\\u3002\"]}),`\n`]}),`\n`,(0,e.jsx)(n.h2,{children:\"\\u4F55\\u65F6\\u4F7F\\u7528\\u7BAD\\u5934\\u51FD\\u6570\"}),`\n`,(0,e.jsxs)(n.ul,{children:[`\n`,(0,e.jsx)(n.li,{children:\"\\u5F53\\u4F60\\u9700\\u8981\\u4E00\\u4E2A\\u5FEB\\u901F\\u7684\\u3001\\u5355\\u884C\\u7684\\u51FD\\u6570\\u65F6\\u3002\"}),`\n`,(0,e.jsxs)(n.li,{children:[\"\\u5728\\u56DE\\u8C03\\u51FD\\u6570\\u4E2D\\uFF0C\\u5F53\\u4F60\\u60F3\\u8981\\u4FDD\\u7559 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u7684\\u8BCD\\u6CD5\\u4F5C\\u7528\\u57DF\\u65F6\\u3002\"]}),`\n`,(0,e.jsxs)(n.li,{children:[\"\\u5728\\u4F7F\\u7528 \",(0,e.jsx)(n.code,{children:\"map\"}),\"\\u3001\",(0,e.jsx)(n.code,{children:\"filter\"}),\"\\u3001\",(0,e.jsx)(n.code,{children:\"reduce\"}),\" \\u7B49\\u9AD8\\u9636\\u51FD\\u6570\\u65F6\\u3002\"]}),`\n`]}),`\n`,(0,e.jsx)(n.h2,{children:\"\\u4F55\\u65F6\\u4E0D\\u8981\\u4F7F\\u7528\\u7BAD\\u5934\\u51FD\\u6570\"}),`\n`,(0,e.jsxs)(n.ul,{children:[`\n`,(0,e.jsxs)(n.li,{children:[(0,e.jsx)(n.strong,{children:\"\\u5BF9\\u8C61\\u65B9\\u6CD5\"}),\"\\uFF1A\\u7BAD\\u5934\\u51FD\\u6570\\u6CA1\\u6709\\u81EA\\u5DF1\\u7684 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u4E0A\\u4E0B\\u6587\\uFF0C\\u5728\\u5BF9\\u8C61\\u65B9\\u6CD5\\u4E2D\\u53EF\\u80FD\\u4F1A\\u5BFC\\u81F4\\u610F\\u5916\\u884C\\u4E3A\\u3002\"]}),`\n`,(0,e.jsxs)(n.li,{children:[(0,e.jsx)(n.strong,{children:\"\\u4F5C\\u4E3A\\u6784\\u9020\\u51FD\\u6570\"}),\"\\uFF1A\\u7BAD\\u5934\\u51FD\\u6570\\u4E0D\\u80FD\\u4F5C\\u4E3A\\u6784\\u9020\\u51FD\\u6570\\u4F7F\\u7528\\uFF0C\\u5982\\u679C\\u4F7F\\u7528 \",(0,e.jsx)(n.code,{children:\"new\"}),\" \\u5173\\u952E\\u5B57\\u4F1A\\u5F15\\u53D1\\u9519\\u8BEF\\u3002\"]}),`\n`,(0,e.jsxs)(n.li,{children:[(0,e.jsx)(n.strong,{children:\"\\u5F53\\u4F60\\u9700\\u8981\\u4F7F\\u7528\\u51FD\\u6570\\u63D0\\u5347\"}),\"\\uFF1A\\u4E0E\\u4F20\\u7EDF\\u7684\\u51FD\\u6570\\u58F0\\u660E\\u4E0D\\u540C\\uFF0C\\u7BAD\\u5934\\u51FD\\u6570\\u4E0D\\u4F1A\\u63D0\\u5347\\u3002\"]}),`\n`]}),`\n`,(0,e.jsxs)(n.p,{children:[\"\\u7BAD\\u5934\\u51FD\\u6570\\u662F JavaScript \\u7684\\u4E00\\u4E2A\\u5F3A\\u5927\\u8865\\u5145\\uFF0C\\u7B80\\u5316\\u4E86\\u51FD\\u6570\\u8BED\\u6CD5\\uFF0C\\u5E76\\u89E3\\u51B3\\u4E86\\u4F20\\u7EDF\\u51FD\\u6570\\u4E2D \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u5173\\u952E\\u5B57\\u7684\\u4E00\\u4E9B\\u5E38\\u89C1\\u95EE\\u9898\\u3002\\u5B83\\u4EEC\\u5728\\u73B0\\u4EE3 JavaScript \\u5F00\\u53D1\\u6A21\\u5F0F\\u4E2D\\u7279\\u522B\\u6709\\u7528\\u3002\"]})]})}function N(r={}){let{wrapper:n}=r.components||{};return n?(0,e.jsx)(n,Object.assign({},r,{children:(0,e.jsx)(s,r)})):s(r)}var S=N;return x(M);})();\n;return Component;" + "solution": "var Component=(()=>{var u=Object.create;var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var f=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),g=(t,n)=>{for(var c in n)o(t,c,{get:n[c],enumerable:!0})},l=(t,n,c,r)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let i of m(n))!b.call(t,i)&&i!==c&&o(t,i,{get:()=>n[i],enumerable:!(r=a(n,i))||r.enumerable});return t};var v=(t,n,c)=>(c=t!=null?u(p(t)):{},l(n||!t||!t.__esModule?o(c,\"default\",{value:t,enumerable:!0}):c,t)),j=t=>l(o({},\"__esModule\",{value:!0}),t);var s=f((N,d)=>{d.exports=_jsx_runtime});var A={};g(A,{default:()=>_,frontmatter:()=>x});var e=v(s()),x={title:\"\\u7BAD\\u5934 => \\u51FD\\u6570\\u8BED\\u6CD5\\u6709\\u4EC0\\u4E48\\u7528\\u4F8B\\uFF1F\",subtitle:\"\\u8FD9\\u79CD\\u65B0\\u8BED\\u6CD5\\u4E0E\\u5176\\u4ED6\\u51FD\\u6570\\u6709\\u4F55\\u4E0D\\u540C\\uFF1F\"};function h(t){let n=Object.assign({h2:\"h2\",p:\"p\",code:\"code\",pre:\"pre\",hr:\"hr\",h3:\"h3\",ul:\"ul\",li:\"li\",a:\"a\"},t.components);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.h2,{children:\"TL;DR\"}),`\n`,(0,e.jsxs)(n.p,{children:[\"\\u7BAD\\u5934\\u51FD\\u6570\\u4E3A\\u7528 JavaScript \\u7F16\\u5199\\u51FD\\u6570\\u63D0\\u4F9B\\u4E86\\u4E00\\u79CD\\u7B80\\u6D01\\u7684\\u8BED\\u6CD5\\u3002\\u5B83\\u4EEC\\u5BF9\\u4E8E\\u5728\\u65B9\\u6CD5\\u548C\\u56DE\\u8C03\\u4E2D\\u7EF4\\u62A4 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u4E0A\\u4E0B\\u6587\\u7279\\u522B\\u6709\\u7528\\u3002\\u4F8B\\u5982\\uFF0C\\u5728\\u4E8B\\u4EF6\\u5904\\u7406\\u7A0B\\u5E8F\\u6216\\u50CF \",(0,e.jsx)(n.code,{children:\"map\"}),\" \\u8FD9\\u6837\\u7684\\u6570\\u7EC4\\u65B9\\u6CD5\\u4E2D\\uFF0C\\u7BAD\\u5934\\u51FD\\u6570\\u53EF\\u4EE5\\u7B80\\u5316\\u4EE3\\u7801\\u5E76\\u907F\\u514D \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u7ED1\\u5B9A\\u95EE\\u9898\\u3002\"]}),`\n`,(0,e.jsx)(n.pre,{live:!0,children:(0,e.jsx)(n.code,{className:\"language-js\",children:`const numbers = [1, 2, 3];\nconst doubled = numbers.map((n) => n * 2);\nconsole.log(doubled); // [2, 4, 6]\n`})}),`\n`,(0,e.jsx)(n.hr,{}),`\n`,(0,e.jsx)(n.h2,{children:\"\\u65B0\\u7BAD\\u5934 => \\u51FD\\u6570\\u8BED\\u6CD5\\u7684\\u7528\\u4F8B\"}),`\n`,(0,e.jsx)(n.h3,{children:\"\\u7B80\\u5316\\u8BED\\u6CD5\"}),`\n`,(0,e.jsx)(n.p,{children:\"\\u7BAD\\u5934\\u51FD\\u6570\\u63D0\\u4F9B\\u4E86\\u4E00\\u79CD\\u66F4\\u7B80\\u6D01\\u7684\\u7F16\\u5199\\u51FD\\u6570\\u7684\\u65B9\\u5F0F\\u3002\\u8FD9\\u5BF9\\u4E8E\\u77ED\\u51FD\\u6570\\u6216\\u56DE\\u8C03\\u7279\\u522B\\u6709\\u7528\\u3002\"}),`\n`,(0,e.jsx)(n.pre,{live:!0,children:(0,e.jsx)(n.code,{className:\"language-js\",children:`// Traditional function\nconst add = function (a, b) {\n return a + b;\n};\n\n// Arrow function\nconst anotherAdd = (a, b) => a + b;\n\nconsole.log(add(2, 3)); // Output: 5\nconsole.log(anotherAdd(2, 3)); // Output: 5\n`})}),`\n`,(0,e.jsxs)(n.h3,{children:[\"\\u8BCD\\u6CD5 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u7ED1\\u5B9A\"]}),`\n`,(0,e.jsxs)(n.p,{children:[\"\\u7BAD\\u5934\\u51FD\\u6570\\u6CA1\\u6709\\u81EA\\u5DF1\\u7684 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u4E0A\\u4E0B\\u6587\\u3002\\u76F8\\u53CD\\uFF0C\\u5B83\\u4EEC\\u4ECE\\u5468\\u56F4\\u7684\\u8303\\u56F4\\u7EE7\\u627F \",(0,e.jsx)(n.code,{children:\"this\"}),\"\\u3002\\u8FD9\\u5728 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u4E0A\\u4E0B\\u6587\\u53EF\\u80FD\\u5F88\\u68D8\\u624B\\u7684\\u65B9\\u6CD5\\u548C\\u56DE\\u8C03\\u4E2D\\u7279\\u522B\\u6709\\u7528\\u3002\"]}),`\n`,(0,e.jsx)(n.pre,{live:!0,children:(0,e.jsx)(n.code,{className:\"language-js\",children:`function Timer() {\n this.seconds = 0;\n this.increment = () => {\n this.seconds++; // 'this.seconds' is inherited from the outer scope\n console.log(this.seconds);\n };\n}\n\nconst timer = new Timer();\ntimer.increment(); // 1\ntimer.increment(); // 2\n`})}),`\n`,(0,e.jsxs)(n.p,{children:[\"\\u5728\\u4E0A\\u9762\\u7684\\u4F8B\\u5B50\\u4E2D\\uFF0C\\u5728 \",(0,e.jsx)(n.code,{children:\"setInterval\"}),\" \\u4E2D\\u4F7F\\u7528\\u4F20\\u7EDF\\u51FD\\u6570\\u9700\\u8981\\u989D\\u5916\\u7684\\u6B65\\u9AA4\\u6765\\u7EF4\\u62A4\\u6B63\\u786E\\u7684 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u4E0A\\u4E0B\\u6587\\u3002\"]}),`\n`,(0,e.jsx)(n.h3,{children:\"\\u5728\\u6570\\u7EC4\\u65B9\\u6CD5\\u4E2D\\u4F7F\\u7528\\u7BAD\\u5934\\u51FD\\u6570\"}),`\n`,(0,e.jsxs)(n.p,{children:[\"\\u7BAD\\u5934\\u51FD\\u6570\\u901A\\u5E38\\u7528\\u4E8E \",(0,e.jsx)(n.code,{children:\"map\"}),\"\\u3001\",(0,e.jsx)(n.code,{children:\"filter\"}),\" \\u548C \",(0,e.jsx)(n.code,{children:\"reduce\"}),\" \\u7B49\\u6570\\u7EC4\\u65B9\\u6CD5\\u4E2D\\uFF0C\\u4EE5\\u83B7\\u5F97\\u66F4\\u7B80\\u6D01\\u3001\\u66F4\\u6613\\u8BFB\\u7684\\u4EE3\\u7801\\u3002\"]}),`\n`,(0,e.jsx)(n.pre,{live:!0,children:(0,e.jsx)(n.code,{className:\"language-js\",children:`const numbers = [1, 2, 3, 4, 5];\n\n// Traditional function\nconst doubledTraditional = numbers.map(function (n) {\n return n * 2;\n});\n\n// Arrow function\nconst doubled = numbers.map((n) => n * 2);\n\nconsole.log(doubled); // [2, 4, 6, 8, 10]\n`})}),`\n`,(0,e.jsx)(n.h3,{children:\"\\u4E8B\\u4EF6\\u5904\\u7406\\u7A0B\\u5E8F\"}),`\n`,(0,e.jsxs)(n.p,{children:[\"\\u7BAD\\u5934\\u51FD\\u6570\\u53EF\\u7528\\u4E8E\\u4E8B\\u4EF6\\u5904\\u7406\\u7A0B\\u5E8F\\uFF0C\\u4EE5\\u7EF4\\u62A4\\u7C7B\\u6216\\u5BF9\\u8C61\\u7684 \",(0,e.jsx)(n.code,{children:\"this\"}),\" \\u4E0A\\u4E0B\\u6587\\u3002\"]}),`\n`,(0,e.jsx)(n.pre,{live:!0,children:(0,e.jsx)(n.code,{className:\"language-js\",children:`class Button {\n constructor() {\n this.count = 0;\n this.button = document.createElement('button');\n this.button.innerText = 'Click me';\n this.button.addEventListener('click', () => {\n this.count++;\n console.log('count:', this.count);\n });\n document.body.appendChild(this.button);\n }\n}\n\nconst myButton = new Button();\nmyButton.button.click(); // count: 1\nmyButton.button.click(); // count: 2\n`})}),`\n`,(0,e.jsx)(n.h2,{children:\"\\u5EF6\\u4F38\\u9605\\u8BFB\"}),`\n`,(0,e.jsxs)(n.ul,{children:[`\n`,(0,e.jsx)(n.li,{children:(0,e.jsx)(n.a,{href:\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions\",children:\"MDN Web Docs: Arrow functions\"})}),`\n`,(0,e.jsx)(n.li,{children:(0,e.jsx)(n.a,{href:\"https://javascript.info/arrow-functions\",children:\"JavaScript.info: Arrow functions revisited\"})}),`\n`,(0,e.jsx)(n.li,{children:(0,e.jsx)(n.a,{href:\"https://eloquentjavascript.net/03_functions.html\",children:\"Eloquent JavaScript: Functions\"})}),`\n`]})]})}function w(t={}){let{wrapper:n}=t.components||{};return n?(0,e.jsx)(n,Object.assign({},t,{children:(0,e.jsx)(h,t)})):h(t)}var _=w;return j(A);})();\n;return Component;" } \ No newline at end of file diff --git a/apps/web/src/__generated__/questions/quiz/css-link-between-head-and-js-script-just-before-body/zh-CN.json b/apps/web/src/__generated__/questions/quiz/css-link-between-head-and-js-script-just-before-body/zh-CN.json index e07b97802..20d0ff41e 100644 --- a/apps/web/src/__generated__/questions/quiz/css-link-between-head-and-js-script-just-before-body/zh-CN.json +++ b/apps/web/src/__generated__/questions/quiz/css-link-between-head-and-js-script-just-before-body/zh-CN.json @@ -20,13 +20,13 @@ "ranking": 100, "similarQuestions": [], "slug": "css-link-between-head-and-js-script-just-before-body", - "subtitle": "您是否知道任何例外情况?", - "title": "为什么一般来说,将CSS``放在``之间,将JS`