[Javascript]NumberをBigIntに変更するサンプル

書式
let 変数名 =値
typeof( BigInt(変数名) )

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
let nn =123
console.log( typeof( nn ) )
console.log( typeof( BigInt(nn) ) )
let nn =123 console.log( typeof( nn ) ) console.log( typeof( BigInt(nn) ) )
let nn =123

console.log( typeof( nn ) )
console.log( typeof( BigInt(nn) ) )

結果
> “number"
> “bigint"

JavaScript

Posted by arkgame