This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nem from 'nem-sdk'; | |
// EndpointをTestnetに指定します | |
// 第1引数はTestnet用のデフォルトのノード | |
// 第2引数はデフォルトのポート(7890) | |
const endpoint = nem.model.objects.create('endpoint')(nem.model.nodes.defaultTestnet, nem.model.nodes.defaultPort); | |
// Testnetのアドレスを指定します | |
const testnetAddress = 'TAHPGS7CKZAERDU5RGHRCGN4DYGXRLQXO5CPNWIP'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm install nem-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const trimStr = ' string '; | |
// return string | |
console.log(trimStr); | |
// return string | |
console.log(trimStr.trim()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'stringExample'; | |
// return stringexample | |
console.log(str.toLowerCase()); | |
// return STRINGEXAMPLE | |
console.log(str.toUpperCase()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'stringExample'; | |
// return strin | |
console.log(str.substring(0, 5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'stringExample'; | |
// return strin | |
console.log(str.substr(0, 5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'stringExample'; | |
// return [ 'string', 'xample' ] | |
console.log(str.split('E')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'stringExample'; | |
// return strin | |
console.log(str.slice(0, 5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'stringExample'; | |
// return stringHOGExample | |
console.log(str.replace(/E/, 'HOGE')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const str = 'stringExample'; | |
// return 0000000stringExample | |
console.log(str.padStart(20, '0')); | |
// return stringExample0000000 | |
console.log(str.padEnd(20, '0')); |