mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-04 12:12:45 +08:00
Retranslate the complete Japanese online edition from Chinese (#2008)
* Retranslate the complete Japanese online edition from Chinese * Fit Japanese homepage labels and localize heading permalinks * Point Japanese contribution instructions to the Japanese preview * Replace locale conditionals with multilingual UI tables
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
* Author: S-N-O-R-L-A-X ([email protected])
|
||||
*/
|
||||
|
||||
/* Driver Code */
|
||||
/* スタックを初期化 */
|
||||
// JavaScript には組み込みのスタッククラスがないため、Array をスタックとして使う
|
||||
/* 実行用コード */
|
||||
/* スタックを初期化する */
|
||||
// JavaScript には組み込みのスタッククラスがないため、Array をスタックとして使える
|
||||
const stack = [];
|
||||
|
||||
/* 要素をプッシュ */
|
||||
/* 要素をプッシュする */
|
||||
stack.push(1);
|
||||
stack.push(3);
|
||||
stack.push(2);
|
||||
@@ -17,19 +17,19 @@ stack.push(5);
|
||||
stack.push(4);
|
||||
console.log('スタック stack =', stack);
|
||||
|
||||
/* スタックトップの要素にアクセス */
|
||||
/* スタックの先頭要素にアクセスする */
|
||||
const peek = stack[stack.length - 1];
|
||||
console.log('スタックトップ要素 peek =', peek);
|
||||
console.log('スタックの先頭要素 peek =', peek);
|
||||
|
||||
/* 要素をポップ */
|
||||
/* 要素をポップする */
|
||||
const pop = stack.pop();
|
||||
console.log('ポップした要素 pop =', pop);
|
||||
console.log('ポップ後 stack =', stack);
|
||||
|
||||
/* スタックの長さを取得 */
|
||||
/* スタックの長さを取得する */
|
||||
const size = stack.length;
|
||||
console.log('スタックの長さ size =', size);
|
||||
|
||||
/* 空かどうかを判定 */
|
||||
/* 空かどうかを判定する */
|
||||
const isEmpty = stack.length === 0;
|
||||
console.log('スタックは空か =', isEmpty);
|
||||
|
||||
Reference in New Issue
Block a user