Adding Functionality to the Call Button in JavaScript

That’s all the structure and styling your app needs. Now it’s time to cozy up to JavaScript. We’ll start by focusing on the call button’s functionality.

The first thing we’ll do in the main.js JavaScript file is invoke strict mode. That’s as simple as writing strict mode as a string at the top of the file:

 'use strict'​;

Invoking strict mode is good practice. Strict mode will often reveal errors and inconsistencies in your JavaScript that the browser would otherwise suppress or ignore. A strict browser turns out to be a real asset when you’re trying to debug and track down errors in your JavaScript. If you’re interested, you can read more about strict mode at ...

Get Programming WebRTC now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.