JavaScript Equality and Type Checks for Pythonistas

Stephen Gruppetta 15 Lessons 2h 25m Updated intermediate js py

Python’s in compares a record’s contents, so a resent reading is easy to skip. Port the co-op’s if reading in seen: as if (seen.includes(reading)), and JavaScript compares the records by identity instead: the resent reading prints twice, and the check counts four readings instead of three, with no error.

In this course, you’ll port a weather co-op’s Python script, which checks each hour’s readings from four home weather stations before they go on the website, to JavaScript.

By the end of this course, you’ll be able to:

  • Compare records by the fields that identify them, and see why strings and numbers compare by value
  • Check a value’s type when typeof says "object", and an object’s class with instanceof
  • Read the rules == follows, and write the check with === instead
  • Choose between === and Object.is() when NaN or -0 is involved
  • Port the whole readings check to JavaScript

You’ll need Python’s ==, is, and isinstance(), and what mutability means, plus Node 26 and the JavaScript basics: const and let, ===, typeof, functions, arrays, objects, and null and undefined. The Python examples use Python 3.15.

The course mixes short videos and text lessons with exercises, a project that ports the whole readings check, and a quiz.

What’s Included:

  • 15 Lessons
  • Video Subtitles and Full Transcripts
  • Translated Subtitles in 8 Languages
  • 2 Downloadable Resources
  • Interactive Quiz to Check Your Progress
  • 5 Hands-On Coding Exercises
  • Q&A With JavaScript Experts: Ask a Question
  • Certificate of Completion

Downloadable Resources:

Related Learning Paths:

About Stephen Gruppetta

Stephen obtained a PhD in physics and worked as a physicist in academia for over a decade before becoming a programming educator. He's constantly looking for simple ways to explain complex things.

» More about Stephen

← Browse All Courses