Ивановский Торрент трекер


Coercion in JavaScript
Год выпуска: 2015
Производитель: Frontend Masters
Сайт производителя: frontendmasters.com
Продолжительность: 3:19
Тип раздаваемого материала: Видеоклипы
Язык: Английский
Описание: Most people will cite coercion and the == operator as the black magic that should never show up in your programs. Not only is coercion much easier to learn and properly apply than you’ve believed, but avoiding it is missing out on important clarifications in style and readability of your code.


Primitive Types
00:00 - 09:12 Introduction Kyle Simpson begins the course with a brief overview of what he’ll be covering throughout the course. He mentions a number of open source projects he maintains and the book series he is currently writing.
- http://getify.me , http://youdontknowjs.com
09:13 - 22:44 Additional Resources Before diving into the course. Kyle provides an array of resources for developers looking to further their JavaScript knowledge. These includes books, documentation sites, and information on using ES6. He also outlines the agenda for the course.
22:45 - 31:08 Primitive Types The JavaScript specification contains a number of primitive types. These types include Undefined, String, Number, Boolean, and Object. Primitive types are the bases for all variables declarations.
31:09 - 44:24 typeof While some argue that JavaScript does not have variable types, the typeof operator would suggest otherwise. The typeof operator can be used to returns a String representation of a value’s type. Kyle demonstrates the typeof operator and explains it’s sometimes confusing behavior.
44:25 - 55:58 Special Values: NaN Within the JavaScript primitive types, there are a number of special values. For example NaN (not a number), Infinity, or null could be used to represent a value. Kyle begins with an demonstration of NaN.
55:59 - 01:03:20 Special Values: Negative Zero Most mathematicians would agree there is no negative zero value. JavaScript would prove otherwise. Kyle demonstrates how you can get a negative zero value and how it may compares to a zero-value in JavaScript. He also talks about a new ES6 method that will check strict equality.
01:03:21 - 01:06:42 Special Values: Quiz Kyle gives the audience a quick quiz to check their knowledge about special values.
01:06:43 - 01:20:53 Natives In JavaScript, Natives are functions that will covert a value from one type to another. Kyle explains why he recommends never using the new keyword with Natives. He also gives a few examples of more complex Natives like RegExp and Date.
01:20:54 - 01:31:18 ToString The ToString function is one of many abstract operations in JavaScript. This function will convert a value to a String representation. While some conversions are obvious, Kyle spends a few minutes demonstrating some of the more peculiar cases with Arrays and Objects.
01:31:19 - 01:42:10 ToNumber Just like the ToString function, the ToNumber function will convert one value to another. In this case, the conversion is to a number. While number conversions are fairly straight forward, Kyle covers some issues that can lead to larger pitfalls. He also drills a little deeper into how the toNumber coercion is performed behind the scenes.
01:42:11 - 01:46:11 ToBoolean When determining if something is false, the ToBoolean function references a list of “falsy” values. If the object in question is on that list, the result is false. If it isn’t on the list, the result is true. K
Implicit vs. Explicit Coercion
01:46:12 - 01:59:20 Explicit Coercion: Strings & Numbers Explicit coercion happens when it’s obvious from the code that one type is being converted to another. Kyle shares a few code examples demonstrating ways to explicitly coerce values from String to Numbers and vice versa .
01:59:21 - 02:11:47 Explicit Coercion: Booleans While using the Boolean() native function is Kyle’s preference, many developers will use a double negate (!!) to perform Boolean coercion. Kyle explains how this works and demonstrates a few other types of explicit coercion.
02:11:48 - 02:19:47 Implicit Coercion: Strings & Numbers Kyle defines implicit coercion as a side effect of some other operation. In other words, it’s not clear when looking at the code that coercion will occur. Kyle introduces implicit coercion with a few examples using String and Number values.
02:19:48 - 02:28:55 Implicit Coercion: Booleans I most cases, Boolean implicit coercion occurs when performing conditional logic. For example, using a Number or String variable inside an if statement. Kyle talks about Boolean implicit coercion and warns the audience about using a double-equal operator in a boolean comparison.
02:28:56 - 02:34:22 Double-Equal Issues As Kyle mentioned earlier, using a double-equal operator in a Boolean comparison can lead to issues. In some cases a Boolean conversion will occur. In other cases it will not. These inconsistencies are why Kyle recommends avoiding this usage.
02:34:23 - 02:46:02 Implicit Coercion: The Bad Parts Kyle walks through the worst possible offenders with implicit coercion. These are the cases where the result of the coercion is completely unexpected. He leaves the audience with a few practical takeaways and best practices.
02:46:03 - 02:49:31 Implicit Coercion: The Safe Parts While many developers believe implicit coercion to be evil, Kyle shares the opposite view. He gives a number of examples why it can be beneficial and leads to simplified code.
02:49:32 - 02:57:59 Double vs. Triple Equal The double-equal operator allows coercion in a comparison. The triple equal operator does not. Kyle walks through number of example demonstrating how the result of these two operators can differ.
02:58:00 - 03:11:07 Helpful Implicit Coercion Using the double-equal operator can be helpful. Kyle shares some pro-tips about how to determine when this operator should be use. He also talks about the performance impacts of coercion.
03:11:08 - 03:20:48 Coercion Resources & Surprises Kyle wraps up his coverage on coercion with a some helpful resources. He also talks a through a few last surprises he has discovered during his research on coercion.
Файлы примеров: не предусмотрены
Формат видео: MP4
Видео: AVC 960x540 23.976fps 1200kbps
Аудио: AAC 44.1kHz stereo 128kbps


Показать сообщения:    

Текущее время: 20-Сен 17:32

Часовой пояс: UTC - 1

Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах
Вы не можете прикреплять файлы к сообщениям
Вы не можете скачивать файлы

Сайт не предоставляет электронные версии произведений, а занимается лишь коллекционированием и каталогизацией ссылок, присылаемых и публикуемых на форуме нашими читателями. Если вы являетесь правообладателем какого-либо представленного материала и не желаете, чтобы ссылка на него находилась в нашем каталоге, свяжитесь с нами, и мы незамедлительно удалим ее. Файлы для обмена на трекере предоставлены пользователями сайта, и администрация не несет ответственности за их содержание. Просьба не заливать файлы, защищенные авторскими правами, а также файлы нелегального содержания!