紀錄有關在 console 中 debug 的指令
[✍ 持續更新]
複製內容
一般來說可以在 console 中印出陣列,但 console 會顯示階層式的物件,如果想要複製單純內物件內容,就要透過下列動作達成:
Right-click an object in Chrome’s console and select Store as Global Variable from the context menu. It will return something like temp1 as the variable name.
Chrome also has a copy() method, so copy(temp1) in the console should copy that object to your clipboard.
1 | (9) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] |
Javascript / Chrome - How to copy an object from the webkit inspector as code