JS 百題斬

Nothing is true, everything is permitted.
1. 減數字字串,會轉回數字型別
2.



3. b 會省略後面不是數字的字串,所以是 15
(如果說 parseInt 碰上了無法被 radix 指定的進位制所轉換的字元,它會忽略該字元、以及其後所有字元)

4.

Search for a command to run...

Nothing is true, everything is permitted.
1. 減數字字串,會轉回數字型別
2.



3. b 會省略後面不是數字的字串,所以是 15
(如果說 parseInt 碰上了無法被 radix 指定的進位制所轉換的字元,它會忽略該字元、以及其後所有字元)

4.

No comments yet. Be the first to comment.
https://youtu.be/Rr5AqASIyxw TL;DR When using 0 in JSX, although it's falsy, it still gets rendered. Official documentation specifically warns to be careful Logical AND operator (&&) Be especially mindful of the usage of the number 0 when using...
https://youtu.be/I7dwJxGuGYQ Step 1: Create the Theme Context First, we need to create the context for our theme. import React, { createContext, useState } from 'react'; type Theme = 'dark' | 'light'; type ThemeContextProps = { theme: Theme; s...
Solution with comments //=========== visualization ==================== Initial state: l1: { val: 1, next: { val: 2, next: { val: 4, next: null } } } l2: { val: 1, next: { val: 3, next: { val: 4, next: null } } } //=========== visualization...
Compiling .proto Files into TypeScript Using ts-proto In my experience working with an Nx monorepo Next.js project on Windows, I encountered a path issue that prevented me from compiling the .proto file directly. To resolve this problem, I had to cre...
https://youtu.be/qwhMyVVnmKM nextjs-youtube-demo Link Global Layout and CSS Nav dynamic className base on the route getStaticProps export async function getStaticProps() { const response = await fetch("https://learnwebcode.github.io/json-examp...