Created
October 23, 2017 06:34
-
-
Save jessecogollo/c11e463407a424d4d7967eb4ae40633a to your computer and use it in GitHub Desktop.
format
This file contains hidden or 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
'use strict'; | |
const { | |
format | |
} = require('util'); | |
const strFormat = format('%s:%s', 'foo');//%s -> string | |
console.log('strFormat', strFormat); | |
const numberFormat = format('%d:%d', 5.2); | |
console.log('numberFormat', numberFormat); | |
const intFormat = format('%i:%i', 5); | |
console.log('intFormat', intFormat); | |
const jsonFormat = format('%j:%j', {key: true}); | |
console.log('jsonFormat', jsonFormat); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment