tsプログラミング練習
create by gpt
typescriptやjsonに登場する記号や数字の練習
関連タイピング
-
プレイ回数2 長文かな753打
-
プレイ回数2 英語長文807打
-
create by gpt
プレイ回数2 英語長文745打 -
created by gpt
プレイ回数5 長文かな60秒 -
create by gpt
プレイ回数1 英語長文656打 -
プレイ回数2 英語長文921打
-
create by gpt
プレイ回数2 英語長文721打 -
created by gpt
プレイ回数1 長文かな723打
問題文
ふりがな非表示
ふりがな表示
(const userId: number = 1001;)
const userId: number = 1001;
(let userName: string = "tanaka_01";)
let userName: string = "tanaka_01";
(const isActive: boolean = true;)
const isActive: boolean = true;
(const scores: number[] = [10, 20, 30, 40];)
const scores: number[] = [10, 20, 30, 40];
(type User = { id: number; name: string };)
type User = { id: number; name: string };
(const user: User = { id: 1, name: "Alice" };)
const user: User = { id: 1, name: "Alice" };
(function sum(a: number, b: number): number { return a + b; })
function sum(a: number, b: number): number { return a + b; }
(const total = sum(5, 10);)
const total = sum(5, 10);
(if (total >= 10 && total !== 15) { console.log(total); })
if (total >= 10 && total !== 15) { console.log(total); }
(const now: Date = new Date();)
const now: Date = new Date();
({ "id": 1, "name": "Bob", "age": 25 })
{ "id": 1, "name": "Bob", "age": 25 }
({ "items": [1, 2, 3], "count": 3 })
{ "items": [1, 2, 3], "count": 3 }
({ "isActive": false, "score": 99.5 })
{ "isActive": false, "score": 99.5 }
({ "user": { "id": 10, "role": "admin" } })
{ "user": { "id": 10, "role": "admin" } }
({ "tags": ["ts", "json", "api"], "public": true })
{ "tags": ["ts", "json", "api"], "public": true }
(const apiUrl = "https://api.example.com/v1/users";)
const apiUrl = "https://api.example.com/v1/users";
(fetch(apiUrl).then(res => res.json());)
fetch(apiUrl).then(res => res.json());
(const result = value ?? "default";)
const result = value ?? "default";
(const map = new Map<string, number>();)
const map = new Map<string, number>();
(export default function main(): void {})
export default function main(): void {}
など
(const price: number = 3980 + 200 * 1.1;)
const price: number = 3980 + 200 * 1.1;
(let index = 0; while (index < 5) { index++; })
let index = 0; while (index < 5) { index++; }
(const flags: boolean[] = [true, false, true];)
const flags: boolean[] = [true, false, true];
(interface ApiResponse<T> { data: T; status: number })
interface ApiResponse<T> { data: T; status: number }
(const res: ApiResponse<string> = { data: "ok", status: 200 };)
const res: ApiResponse<string> = { data: "ok", status: 200 };
(const ids = users.map(u => u.id).filter(id => id > 10);)
const ids = users.map(u => u.id).filter(id => id > 10);
(const obj = Object.freeze({ x: 1, y: 2 });)
const obj = Object.freeze({ x: 1, y: 2 });
(const merged = { ...a, ...b, updatedAt: Date.now() };)
const merged = { ...a, ...b, updatedAt: Date.now() };
(try { JSON.parse(text); } catch (e) { console.error(e); })
try { JSON.parse(text); } catch (e) { console.error(e); }
(enum Role { Admin = 1, User = 2, Guest = 3 })
enum Role { Admin = 1, User = 2, Guest = 3 }
({ "page": 1, "pageSize": 20, "total": 150 })
{ "page": 1, "pageSize": 20, "total": 150 }
({ "error": { "code": "E401", "message": "Unauthorized" } })
{ "error": { "code": "E401", "message": "Unauthorized" } }
({ "lat": 35.6895, "lng": 139.6917 })
{ "lat": 35.6895, "lng": 139.6917 }
({ "range": { "min": 0, "max": 100 } })
{ "range": { "min": 0, "max": 100 } }
({ "options": { "darkMode": true, "lang": "ja-JP" } })
{ "options": { "darkMode": true, "lang": "ja-JP" } }
(const regex = /^[a-z0-9_-]{3,16}$/i;)
const regex = /^[a-z0-9_-]{3,16}$/i;
(const timeoutId = setTimeout(() => {}, 3000);)
const timeoutId = setTimeout(() => {}, 3000);
(type Status = "idle" | "loading" | "success" | "error";)
type Status = "idle" | "loading" | "success" | "error";
(const tuple: [number, string] = [404, "Not Found"];)
const tuple: [number, string] = [404, "Not Found"];
(const value = Number(input) || 0;)
const value = Number(input) || 0;