JavaScript — Dynamic client-side scripting Flashcards
What is JavaScript?
An interpreted programming language that conforms to the ECMAScript specification. JavaScript is high-level, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions.
What does API stand for?
Application Programming Interface.
What is a simple way of thinking about API’s?
Extra superpowers to use in your JavaScript code.
What is an API?
Ready-made sets of code building blocks that allow a developer to implement programs that would otherwise be hard or impossible to implement.
Give an analogy to how API’s are helpful.
They do the same thing for programming that ready-made furniture kits do for home building — it is much easier to take ready-cut panels and screw them together to make a bookshelf than it is to work out the design yourself, go and find the correct wood, cut all the panels to the right size and shape, find the correct-sized screws, and then put them together to make a bookshelf.
What two categories do API’s generally fall into?
Browser and Third party APIs.
What are Browser API’s?
They’re built into your web browser, and are able to expose data from the surrounding computer environment, or do useful complex things.
What does the DOM (Document Object Model) API allow you to do?
Manipulate HTML and CSS, creating, removing and changing HTML, dynamically applying new styles to your page, etc.
How would you know when the DOM has been used?
Every time you see a popup window appear on a page, or some new content gets displayed.
What are some examples of Browser API’s?
DOM (Document Object Model) API
Geolocation API
The Canvas and WebGL APIs
Audio and Video APIs like HTMLMediaElement and WebRTC
What does the The Geolocation API do?
Retrieves geographical information. This is how Google Maps is able to find your location and plot it on a map.
What does the Canvas and WebGL APIs allow you to do?
Create animated 2D and 3D graphics.
What do Audio and Video APIs like HTMLMediaElement and WebRTC allow you to do?
Really interesting things with multimedia, such as play audio and video right in a web page, or grab video from your web camera and display it on someone else’s computer.
What is something to note about Browser API’s?
Many of them won’t work in an older browser.
What will you need to consider when you get closer to delivering production code (i.e. real code that real customers will use)?
Cross browser testing.