sabell2012
Mega Sage
Mega Sage

NOTE: MY POSTINGS REFLECT MY OWN VIEWS AND DO NOT NECESSARILY REPRESENT THE VIEWS OF MY EMPLOYER, ACCENTURE.

 

DIFFICULTY LEVEL:   BEGINNER
Assumes having a beginner level of knowledge and/or familiarity with Scripting in ServiceNow.


You Don't Know JS: Up & Going

 

by Kyle Simpson

Publication Date: April 2015

72 Pages

ISBN-13: 978-1491924464

ISBN-10: 1491924462

You Don't Know JS: Up & Going - O'Reilly Media

(This is a review of the hard-copy of this book)

sabell2012_1-1700533658913.png

 

Let me start by saying that I feel this book was mis-titled. It should have been named: An Introduction to Programming Using JavaScript! Oh, and btw, the JS in the title stands for JavaScript! 😀

 

This is the first in a series of books by Kyle Simpson that was started very successfully on KickStarter, strangely enough. They have since all been published by O'Reilly Media.

 

In chapter one, justifiably titled: "Introduction to Programming", the author does a great job covering the essentials.   Coding basics such as Statements, Expressions, Operators, and Types are presented with detailed examples and explanations. He then shows the nascent developer how to use their own browser to run basic programs starting with a simple one-line statement. Comments are covered as well as variables and type conversions. He introduces Looping, Conditionals, Functions, and Scope. That last is very often neglected in an introductory text. Simpson closes out the chapter with a coding challenge that gives a set of requirements, and you are asked to develop the solution with what you have learned. Don't worry, Simpson gives you his answer as well! As a senior ServiceNow instructor I really liked that the author encourages the reader to practice. The serious beginning programmer has all the basic tools presented with examples! What more could you ask?

 

Chapter two presents a deeper dive into the topics covered in the first chapter. Here the most commonly used JavaScript types are presented. These include objects (a particular favorite of mine), the basics on Functions, Scoping (which if you don't get this down it will bite you until you do). Also, Closures, the "this" object, and Prototypes are briefly covered (the author leaves these to other books in his series rather than cover them in-depth here). Simpson wraps up the chapter with brief descriptions of Polyfills, and Transpiling. BTW, Polyfills are important to ServiceNow as they allow us to add into Global development some of the newer features of the language - such as those found in ES6. We get these advanced features in Scoped applications now (ECMA 2021).

 

I think one of the nice things about the book is that Simpson only covers up to the JavaScript EC5 version. Since Helsinki we have JavaScript ES5 available. This delivers some pretty cool stuff like const, and "use strict". The author covers the purposes of both; again with examples.

 

Just a side-note here, if you want to test out the code in this book you have some options:

 

1. You could open up Scripts - Background in ServiceNow. This is the easiest option.

2. You could create a Fixed Script or a Scheduled Job in ServiceNow. This is a bit cumbersome for the purpose.

3. You could use an online tool such as JSFiddle. Another easy option, and my favorite.

 

sabell2012_2-1700534227678.png

 

Chapter three, the last chapter, presents an overview of Kyle Simpson's "You Don't Know JS" book series. Here the author briefly outlines each of the titles published to date.    

 

The titles (all of this is JavaScript):

 

With the publication of this article I have the first three of his titles including Up & Going. So far they are all excellent. As I go through each I will write about what I find, and how it can benefit you as a ServiceNow scripter.

 

Don't be fooled by its brevity; this is a great beginner book!

 

Enjoy!

Steven Bell.

 

If you find this article helps you, don't forget to log in bookmark it, and mark it as "Helpful"!

 

sabell2012_0-1700533533401.png


Originally published on: 10-06-2016 07:10 AM

I updated the code and brought the article into alignment with my new formatting standard.