How Google uses Node.js?

Myles Borins, developer advocate for Node.js at Google, shares reasons for why companies decide to use Node.js
Sergey Siminskiy's picture
Sergey Siminskiy
11 August

Snapchat Inc. made the decision to use Google Cloud to host the vast majority of its computing, storage, bandwidth, and other services.

Google Cloud Platform is a suite of cloud computing services that run on the same infrastructure that Google uses internally for its end-user products, such as Google Search and YouTube. Alongside a set of management tools, it provides a series of modular cloud services including computing, data storage, data analytics and machine learning.

In this enterprise conversation, Myles Borins, developer advocate for Node.js at Google, shares reasons for why companies decide to use Node.js, and conversely, what might be blocking some companies from adopting the platform. Myles gives us insights about the overall design of Node.js and the fact that its openness does not always allow for a clear, defined way of building out services, APIs or applications. This reality can either help or hinder the needs of a company.

Myles also provides a variety of use cases around Node.js and offers information about Google’s compute services that currently employ the code, such as Virtual Machines, App Engine environments, and Google Cloud Functions. Learn even more about Google and Node.js by listening to the full interview here. Myles will also be presenting at Node.js Interactive 2017, discussing the history of modules within the JavaScript Ecosystem.

How to set "check" to a checkbox in jQuery?

Small jQuery tutorial on common issue with code examples
Sergey Siminskiy's picture
Sergey Siminskiy
21 August

Let's consider three options for different versions of jQuery.

jQuery 1.6+

Use the new .prop() method:

$('.myCheckbox').prop('checked', true);
$('.myCheckbox').prop('checked', false);

jQuery 1.5.x and below

The .prop() method is not available, so you need to use .attr().

$('.myCheckbox').attr('checked', true);
$('.myCheckbox').attr('checked', false);

Note that this is the approach used by jQuery's unit tests prior to version 1.6 and is preferable to using

$('.myCheckbox').removeAttr('checked');

since the latter will, if the box was initially checked, change the behaviour of a call to .reset() on any form that contains it - a subtle but probably unwelcome behaviour change.

Any version of jQuery

If you're working with just one element, you can always just modify the HTMLInputElement's .checked property:

$('.myCheckbox')[0].checked = true;
$('.myCheckbox')[0].checked = false;

The benefit to using the .prop() and .attr() methods instead of this is that they will operate on all matched elements.