What are Javascript Objects? Containers for Reusable Properties and Behaviors

Javascript is a versatile programming language; you can create short scripts of only a few lines or complex modules that contain many. Developers handling many web pages often need to reuse their Javascript code; copying and pasting scripts between pages is a tedious and error-prone process.

The Javascript standard provides the ability to create reusable code in the form of Javascript objects. Javascript objects provide complex functionality with minimal code, making new scripts easy to maintain and fast to load.

Continue Reading

Javascript Hub: Strategies to Create Dynamic Web Pages

Javascript is a vital part of dynamic content on the modern web. From simple scripts to complex interactions that require frameworks, Javascript enhances user experiences on the web.

There are two major types of Javascript, and this Udacity Javascript hub covers both. The first type is “vanilla” Javascript, scripts you can write using the basic rules in the Javascript standard. The second type is framework-driven Javascript that creates complex content building upon others’ frameworks, like Angular and React or libraries like FusionCharts.

This Javascript hub contains easy-to-follow guides on a wide range of Javascript topics. Most articles provide sample code to demonstrate how Javascript works in the real world.

This hub is meant to be a comprehensive resource, so we will add new content as it’s published. Check back here for more Javascript content.

Continue Reading

Converting Javascript Objects into Strings with JSON.stringify()

JSON stringification is the process of converting a Javascript object to a flat JSON string that can be used inside a program. In Javascript, the standard way to do this is by using the method JSON.stringify(), as the Javascript standard specifies.

JSON.stringify() is the opposite of JSON.parse(), which converts JSON into Javascript objects. This article and Udacity’s JSON.parse() article have similar structures to emphasize the close relationship between the two functions.

Continue Reading

Introducing the Full Stack JavaScript Developer Nanodegree Program from Udacity

Every developer worth their salt knows JavaScript — the most-used language for 2020 according to Github’s recent State of the Octoverse report. In fact, using JavaScript to create an app from scratch is a highly coveted skill, and more than 25,000 jobs have been posted in the last year looking for people with “full stack JavaScript” skills according to a Burning Glass Labor Insights report.

With the demand for full stack JavaScript developers only increasing, Udacity is launching the newest addition to our School of Programming: the Full Stack JavaScript Developer Nanodegree program. The Nanodegree program will focus on teaching a breadth of knowledge for all things JavaScript, including client, server and database layers of an app. 
While Udacity already has the Full Stack Web Developer Nanodegree program, this new program focuses solely on JavaScript.

Continue Reading

Manipulating HTML Through the Javascript Document Object Model (DOM)

Javascript creates dynamic content on web pages by manipulating the underlying HTML structure. Browsers manage HTML internally as a tree of objects called the Document Object Model, or DOM. Developers refer to the tree objects as “elements.” The DOM also applies to XML and XHTML documents, which most modern browsers can display as well.

The DOM standard specifies how a browser builds an HTML tree and how scripting languages like Javascript should access elements in that tree. Although the Javascript standard implements concepts from the DOM standard, the two standards are different, maintained by different groups.

Continue Reading

Javascript Basics Tutorial

The Javascript standard is extensive — more than 1,100 printed pages — so it is far beyond the scope of this article to provide basic information on every Javascript (JS) characteristic and feature. Instead, this article will introduce you to the characteristics of Javascript that make it such a popular language while mentioning a few caveats to remember when using Javascript in your own projects.

Continue Reading

Comparing Values by Using Operators: Javascript AND, Javascript OR, and Many More

Comparing one value to another is an important programming technique that developers use to create logical flows. Javascript provides many ways to compare simple values using language constructs called “operators.”

The Javascript standard defines two different types of simple operators.

  • Logical Operators — logical relationships between values
  • Comparison Operators — how values are related to each other

These operators work with Javascript data types that hold simple values, like strings or numbers, but cannot handle complex values like Javascript objects, arrays, or functions. To compare complex objects, developers must write their own comparison functions.

Make sure that the compared values or variables are the same data type; otherwise you may get an answer you don’t expect. Each operator type has different rules for valid comparisons, which the next sections will cover in more detail.

Continue Reading