[英]How do I output a string or number in JavaScript using format specifier?
var b=4; //variable
document.write("The value of b is %d", b);
在 Java 中,它将是:
int b;`
System.out.printf("the value of b is %d", b);
尝试这样做:
let b = 4;
let valueString = `The value of B is: ${b}`
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.