Notes

Working notes on Notes: if(!!var), undefined, Null, if (typeof something === \"undefined\"), Delete Node, and Parent.

UjnotesCC0 1.0

Working notes on Notes: if(!!var), undefined, Null, if (typeof something === \"undefined\"), Delete Node, and Parent.

Detect Null.

if(!!var)

Not Null.

Ie. also Not 0 (not effective for undefined).

undefined

=== undefined.

Null

===null.

________________.

Detect Undefined Object (Prevent Exception).

if (typeof something === "undefined")

Alert("something is undefined");.

________________.

Delete Node

Parent

E.parentNode.removeChild(e);.

________________.

<script type="text/javascript">presentation()</script>

Script content with src attribute is not executed.

Script updated by innerHtml is not executed.

________________.

Detect

http://diveintohtml5.info/everything.html

Library. Http://modernizr.com/.

________________.

Get Text after substring.

Var s = "aijfoi aodsifj adofija afdoiajd?order_num=3216545";.

Var m = s.match(/([^\?]*)\?order_num=(\d*)/);.

Var num = m[2], rest = m[1];.

________________.

Document.getElementById('classRight').style.display = 'none';.

Alternatively (not recommended). Document.getElementById("classRight").setAttribute("style","display:none;");.

________________.

The function is called as soon as it is declared.

(.

Function (...).

{.

….

}.

)(...);.

________________.

AddEventListner in Chrome.

AttachEvent in IE9.

________________.

onclick

Pass this as param (to not have to refer using id).

________________.

Open url and mailto

url - self
mailto - blank

________________.

Break

Debugger;.

Log

Log Console.log(<message>);

________________.

Cannot pass parameters to function pointer.

________________.

Variable ‘hoisting’.

Variable initialized with.

________________.

In JavaScript, an undeclared variable is assigned the value undefined at execution and is also of type undefined.

________________.

All undeclared variables are global variables.

Hoisting causes the variable declaration to implicitly occur at the top of current scope.

Assignment though occurs at usual spot.

‘use strict’ changes hoisting behaviour.

Variables are no longer hoisted.

Updated: 2026 Aug 19