What I learned while preparing for the Microsoft 70-480 exam – js

This is the third and probably my final post about 70-480 exam: Programming in HTML5 with CSS and Javascript. You need to be familiar with Javascript and Jquery for the exam. I am pointing a few things about Javascript on this article. And also, this is the follow-up of the post series “What I learned while preparing for the Microsoft 70-480 exam“. 


  1. Form post sends form data as a query string. QueryString is limited in size by the web browser and web server you use. For example, when using Internet Explorer and Internet Information Server (IIS), the limit is 1,024 characters.
  2. Array Object’s Method

[0,1,2,3,4,5].slice(1,3) => [1,2] ————- doesn’t returns end tag

[0,1,2,3,4,5].splice(1,3, “add as”, “much as”, “you want”) =>  [1, 2, 3] and main array change to 0,add as,many as,you want,4,5

  1. Capturing and Bubbling

When the button is clicked, the capture process takes place where the click event is triggered on the document object, the HTML object, the body object, the hyperlink, and, finally, on the button object. Next, the bubble process takes place where the click event is triggered on the hyperlink object, the body object, the HTML object, and, finally, on the document object

btn.addEventListener('click', function(e){}, false);
[true-capturingPhase | false-bubblingPhase(default)])
  • inline event subscription is added to the bubbling process
  • e.preventDefault() -> Prevent default behavious
  • e.stopPropogation() -> prevent bubble up


  1. The this keyword references the object that caused the event.
  2. The this keyword provides a reference to the owner of the function.
  3. When a function is invoked on or through an object, that object is the invocation context (aka this) for the function

Keyboard events

  • the keyboard event object has the which ;
var charStr = String.fromCharCode(e.which);


  1. promise object can be in one of three states: pending, resolved, or rejected
  2. When you need to create a promise object whose state is resolved, use the $.when() method.
  3. The deferred object is a wrapper for the promise object. The deferred object provides control of the promise object, which is read-only.
    • The promise object has the done, fail, always, and progress methods that accept a function parameter, which enables you to subscribe to the state change. The then() method on the promise object enables you to subscribe to done, fail, and progress.
    • The subscription functions execute a maximum of one time.
    • The state method can be used to get the current state of the promise object.
    • The promise object’s pipe method chains asynchronous operations.
    • The deferred object’s resolve and resolvewith methods indicate successful completion. The deferred object’s reject and rejectwith methods indicate a failed operation. The deferred object’s notify and notifywith methods update the progress.
    • The name of all functions that perform asynchronous calls should end with Async, and these functions should always return a promise object.
    • Use the $.when() method to monitor the completion of many parallel asynchronous calls.
  4. Chained and parallel asynchronous operations automatically pass failure and progress to the end of the chain.
  5. Call “notify” on the deferred object to indicate a change in progress


  1. You can stop a web worker by calling the worker.terminate() method from the creator or calling the close() method inside the worker itself.
  2. The WebSocket protocol is a web technology that provides full-duplex communications over a single TCP connection.
  3. If you do not specify a section name, by default the CACHE section is assumed on AppCache
  4. Web storage allows upto 5mb date and (10mb data IE) on client
  5. Cookies allow 4kb
  6. Define a function in constructor. var f = new Function(“x”, “y”, “return x * y;”); Last arg is body
  7. These statements are true: null == undefined, ‘’ == 0 , ‘123’ == 123
  8. defineProperty: If a descriptor has both value or writable and get or set keys, an exception is thrown.
  9. parse: If you return undefined for a property, the property is removed from resulting object
  10. Existing properties in objects frozen with freeze()are made immutable. Objects sealed with Object.seal() can have their existing properties changed.
  11. An object inherits properties from its prototype, even if the prototype changes after the object is created
  12. document’s DOMContentLoaded event fires earliest Load is the last
  13. JavaScript Null-Coalescing Operator ||: answer = x || someDefault;
  14. Prototype doesn’t have access to private variables
  15. toDataUrl() can be use as image uri

Drag API

  1. Dragged element events: dragstart, drag, dragend
  2. Drag item drop events: dragenter, dragover, dragleave, drop


  1. Get file asynchronously
    1. Assign a new instance of XMLHttpRequest to xhr
    2. Register a handler for event onreadystatechange
    3. Invoke xhr.open(GET/POST, url, true)
    4. Invoke xhr.send([data for POST])
  2. Xhr done=4, open=1,loading=3, headersReceived=2


  1. ~= searches for the word (term delimited by spaces) in all text
  2. ^= searches for the term at the beginning
  3. $= searches for the term at the end
  4. != searches for non-matches
  5. Next Siblings (“prev ~ siblings”)
  6. Next Adjacent selector (“prev + next”) — All elements that are immediately preceded by a sibling “prev”
  7. Most jQuery functions return arrays
  8. Jquery :has check matching element that has an element with has a tag

Useful links


I have noted these links and points to skim through on my exam day while preparing for the exam. And honestly, it helped. I have included the only javascript things here. Eventually, I have added three articles to share my cheat sheet for the 70-480 exam: Programming in HTML5 with Javascript & CSS3. And they are

  1. CSS3 – What I learned while preparing for the Microsoft 70-480 exam
  2. HTML5 – What I learned about HTML5 elements while preparing for the Microsoft 70-480 exam
  3. Javascript –  What I learned while preparing for the Microsoft 70-480 exam – js

What do you think about these articles? What did I miss? Please let me know if I could improve anything. If you enjoyed these notes, please share it with your colleagues and friends! And you can also connect with me on twitter or LinkedIn. I would be happy to hear from you.


I would like to hear your thoughts