When sorting out the impression note, I found these bits and pieces of unpopular knowledge……

Attention!!!!! This is a self-entertaining and unnourishing article (knock on the blackboard!!).

1. Did you know that the browser’s address bar can run HTML code?

data:text/html,<div id="J_test">test</div>
Copy the code

Isn’t that amazing? ! This can only be done on non-IE browsers.

2. Did you know all element ids are global variables?

The output is the same in both ways. Terminal debugging only!! In actual code, just write whatever you want.

3. Did you know console.log can change colors?

Using % C lets you dig through a bunch of debugging information!

4. Learn about the debugger

As long as the debugger is written in the code, the browser will automatically stop there when running, simple and rude, remember to delete…… Khan,

For functions other than private and anonymous functions, typing Debug (funcName) in the console helps you quickly locate the function to be debugged.

var Test = function () {
	this.func1 = function () {
		console.log('debug test')
	}
}
var test = new Test()
debug(test.func1)
test.func1()
Copy the code

5. Console. Table?

It’s a little bit useful to output objects as tables.

6. Console.time () and console.timeend () Test time

Want to know how long a piece of code took? Console.time () and console.timeend () to help you!

7. You probably didn’t even notice this little button in Chrome

Beautify the compressed code, one step in place!

8. The headache of vertical center translateY comes to help

/* vertical-center */. Vertical-center {position: relative; top: 50%; transform: translateY(-50%); } /* horizontal-center */. Horizontal-center {position: relative; left: 50%; transform: translateX(-50%); }Copy the code

9. Want to know how many times your code is executed?

emmmm…… Console.count () is a very useful thing.

But !!!! Remember to delete it after use, so as not to block the execution of code because of a sentence console.count, remember to remember!!