正解:B,C,D,E
The correct answers are B, C, D, and E .
JavaScript browser consoles support string substitution in several console output methods. String substitution means using placeholders such as:
%s
%d
%i
%f
%o
%O
%c
Example:
console.log( " User name is %s and age is %d " , " Alex " , 25);
Output:
User name is Alex and age is 25
The valid console methods from the given options are:
Option
Method
Correct?
Reason
A
message
No
console.message() is not a standard console method.
B
log
Yes
console.log() supports formatted string substitution.
C
assert
Yes
console.assert() can output a formatted message when the assertion is false.
D
info
Yes
console.info() supports formatted output like console.log().
E
error
Yes
console.error() supports formatted output and displays an error-style message.
Example with these valid methods:
console.log( " Name: %s " , " John " );
console.info( " Score: %d " , 95);
console.error( " Error code: %d " , 500);
console.assert(false, " Failed check for user: %s " , " Admin " );
So the verified answers are B, C, D, and E .