前端開發中常常用到瀏覽器的console
控制檯,
而在console.log
和console.debug
中有時候能夠看見%d
%s
這樣的符號,其意義和用法以下javascript
%s
for a String value 表明字符串%d
或 %i
for a Integer value 表明整數%f
for a Floating point number 表明浮點數%o
for an Object hyperlink 表明對象的超連接var name = "David"; var num = 24; var height = 180.5; var obj = { job: 'web developer', }; console.log('%s is %d years old, and he is %fcm tall.\nMore details in: %o', name, num, height, obj);
https://stackoverflow.com/que...
https://blog.csdn.net/linusc/...前端