スマホの実機画面にconsole.logの結果を出力して、デバッグをしやすくする簡単な方法を紹介します。
jsを利用時にスマホで確認しててスマホのときに正確に値が切り替わってるのかわからない時ってないですか。私はあります。
結構スマホ時の挙動とかでこれ変わってる?ってのがちょこちょこでてくるのですが、その時にこちらは便利。ログがスマホでも出るのでほんとに変わってる?ってなることがなくて正確性が上がります。
またスマホでログ見たくなったときのためにメモしておきます。

#ryland grace#phm#rocky the eridian#project hail mary spoilers


seen from Canada
seen from United States

seen from United States
seen from United States

seen from China

seen from United States
seen from New Zealand
seen from China

seen from United States
seen from United States

seen from United States
seen from China
seen from United States
seen from Canada
seen from China
seen from Brazil
seen from United States
seen from United States

seen from Australia
seen from Israel
スマホの実機画面にconsole.logの結果を出力して、デバッグをしやすくする簡単な方法を紹介します。
jsを利用時にスマホで確認しててスマホのときに正確に値が切り替わってるのかわからない時ってないですか。私はあります。
結構スマホ時の挙動とかでこれ変わってる?ってのがちょこちょこでてくるのですが、その時にこちらは便利。ログがスマホでも出るのでほんとに変わってる?ってなることがなくて正確性が上がります。
またスマホでログ見たくなったときのためにメモしておきます。
How to stop using console.log() and start using your browser’s debugger
How to stop using console.log() and start using your browser’s debugger
When I started my journey to become a software developer, I definitely ran into my fair share of bumps in the road. One of the most common struggles that most new developers face is debugging. At first, I thought I discovered the holy grail when I realized that I could open the console in chrome and console.log() out my values to discover where my bugs were. This turned out to be highly…
View On WordPress
Connie Dotlogue
Console.log has become my best friend. That’s too much. It’s not like console.log will ever encourage me to go for that second scoop of ice cream. Rather, console.log has become my code-specific bestie, Connie Dotlogue. Looking back on how I started to learn JavaScript, console.log was not unlike knitting that gauge swatch. I hated it. It was a time waster. It came between coming up with a new…
View On WordPress
Chrome Console Log Weirdness
Take the following code and run it in jsFiddle:
var Master = function (options) { this.options = options; console.log('>>OPTIONS'); console.log(options); console.log('>>THIS.OPTIONS'); console.log(this.options); console.log('>>THIS'); console.log(this); };
var Me = function () {};
Me.prototype = new Master({one: 234, two: 876});
var me = new Me();
me.options.one = 1;
If you inspect the output in the console, you'll see the following:
>>OPTIONS (index):23
Object {one: 234, two: 876} (index):24
>>THIS.OPTIONS (index):25
Object {one: 234, two: 876} (index):26
>>THIS (index):27
Master {options: Object}
options: Object
one: 1
two: 876
__proto__: Object
__proto__: Object
If you expand "Master" (this), then expand options, you'll see that "options.one" is "1". Wait, why is "this.options.one" still "234"? For some reason, when you expand an object in the console, it shows you the updated referenced value. Remember that arrays and objects are passed by reference and not value. If console logging "this" shows the updated value, why doesn't plain old "this.options" get updated?
If you were to change the console.log(this) to alert(JSON.stringify(this)), you'll see that "this.options.one" is still "234". This is because the output hasn't reached "me.options.one = 1".
So why would "console.log(this)" show "1" instead of "234"? Well, seems like expanding the object tree reveals the updated value, despite being called before "options.one" is changed.