@wywm@z[y[W
ŏIXVF2025N15
@consoleIuWFNǵAJavaScript̃vÕfoOsɎgIuWFNgłBGoogle ChromȅꍇAHTMLsĕ\ɁA[F12]L[āAJc[NƁA[vf]@[R\[]@[\[X]@[lbg[N]@[ptH[}X]@[]@[AvP[V]@[ZLeB]Əꂽj[oĂ܂A̒[R\[]NbNƁAR\[ʂoĂ܂BconsoleIuWFNg̃\bhɂ͈ȉ̂悤Ȃ̂܂BconsoleIuWFNg̃eXgEvOB
console.clear
@R\[ʂNA܂B
console.log
@R\[ʂɁÃ^Cvɑe\܂BłA\܂Bzar1łA
var ar1 = ['abc', 'def', 'ghij'];
console.log(ar1);
ƂƁAz̗vfƓeAR\[ʂɁA
(3) ['abc', 'def', 'ghij']
̂悤ɕ\܂BIuWFNg̔zar2łA
var obj1 = { 'name' : 'abc', 'value' : 12, 'color' : 'black' };
var obj2 = { 'name' : 'defg', 'value' : 302, 'color' : 'yellow' };
var obj3 = { 'name' : 'hijkl', 'value' : 7, 'color' : 'cyan' };
var ar2 = [];
ar2.push(obj1);
ar2.push(obj2);
ar2.push(obj3);
console.log(ar2);
ƂƁA܂́AR\[ʂɁA
▶ (3) [{c}, {c}, {c}]
ƕ\܂A'▶'̂ƂNbNƁA'▶'''ɕςāA
▶ 0F{name: 'abc', value: 12, color: 'black'}
▶ 1F{name: 'defg', value: 302, color: 'yellow'}
▶ 2F{name: 'hijkl', value: 7, color: 'cyan'}
length: 3
ƕ\܂B̂悤ɂāAzconsole.log\bḧƂ邾ŁAz̓emFł܂B
@console.logł́A䂪\łB%s͕A%d͐A%f͕_A%O̓IuWFNgȂ%cƂCSS̕ɂ\sƂł܂(\ł͂Ȃ̂ŒӂĂ)BcolorCfontCbackground-color̎wȂǂs܂B
st1 = "color:blue;background-color:lightgreen";
count1 = 7;
f1 = 3.1415926583;
consoloe.log("%cڐF%dC~F%f", st1, count1, f1);
ƂƔΐF̔wiFAF̕ŁAڐF7, ~F3.1415926583ƃR\[ʂɕ\܂B
console.trace
@Ăꂽǂ̂悤ȊĂĂ邩Xg\܂(X^bNEg[Xƌ܂)Bȉ̂悤func1()̒func2()ĂяoAfunc2()̒console.trace()ƂƁA
func1();
function func1() {
func2();
}
function func2() {
console.trace();
}
ʂɁAĂяoĂƁAHTMLt@C̉sڂŌĂяoĂ邩\܂B
console.trace
@func2@@@@ jtest15.html:29
@func1@@@@ jtest15.html:26
@()@@@@ jtest15.html:24
̂悤ɕ\܂Bŏʂ̊ɂ͖OȂ̂ŁA()ƂȂ܂B
console.time()Cconsole.timeEnd()Cconsole.timeLog()
@ԌvɎg\bhłB^C}[ɖOtāA^C}[ɓĎg܂Bconsole.time()Ń^C}[NAconsole.timeLog()Ń^C}[̓roߒl~bPʂŕ\Aconsole.timeEnd()Ń^C}[~߂ƂƂɁAŏIIȒl~bPʂŕ\܂B
console.time("timer1");
console.timeLog("timer1");
console.timeEnd("timer1");
ƂƁAʂɁAtimeLog\bh̒lƁAtimeEnd\bh̒lA
timer1: 0.303955078125 ms
timer1: 0.3330078125 ms
̂悤ɕ\܂B
yLz@LłB̊F܂̂x肽A낵肢܂B
yLz@L͂܂łłB