Files
front-end-example/03-javascript-core/08-built-in-methods/answer.js
charlie 877acb5a8f feat: Add JavaScript core exercises and solutions
- Implemented exercises for array high-order methods, memory and execution, switch statements, and final review.
- Added starter and answer files for each exercise to facilitate learning.
- Created a runner HTML file to execute JavaScript code and display console outputs.
- Updated README files to include exercise objectives, tasks, and usage instructions.
2026-03-13 11:09:19 +08:00

13 lines
417 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const rawTitle = " js 核心练习 ";
const tags = ["变量", "条件", "函数"];
const cleanTitle = rawTitle.trim();
const upperTitle = cleanTitle.toUpperCase();
const hasJS = upperTitle.includes("JS");
const tagLine = tags.join("、");
console.log("清洗后标题:", cleanTitle);
console.log("大写标题:", upperTitle);
console.log("是否包含 JS", hasJS);
console.log("标签列表:", tagLine);