Photo by Museums Victoria on Unsplash

Hello, Operator?

As you can probably infer from their name, operators allow us to perform operations in our code. In the first lesson about variables, we were introduced to the simple assignment operator (=), used to assign values to our variables. Now let’s look at some more operators you’ll use in Ruby.

‘Rithmetic Time

You’ll frequently need to perform arithmetical operators in your code, so Ruby, like other programming languages, provides operators for doing them.

  • + (Addition)
  • - (Subtraction)
  • * (Multiplication)
  • / (Division)
  • ** (Exponent)
  • % (Modulus, or modulo)

The first five probably need no explanation. You shouldn’t have any…


My previous post introduced the concept of Ruby variables, which function as containers for data. Variables facilitate collecting, storing, and using data in your program. Instead of having to rewrite something — a string, a number, an array, etc. — every time you need it in your code, you can just assign it to a variable and reference the variable as often as you need to.

Scope

I focused on local variables last time. Local variables, as their name suggests, have local scope. What is scope? Basically, scope refers to accessibility. For instance, a local variable is only accessible within…


In my previous post, I discussed how I had begun reapproaching the Ruby programming language and would start writing about it on a regular basis. Aside from discussing puts and print to display data, I provided a rundown of Ruby’s data types and discussed how those are all objects in Ruby. In this post, we’ll take a look at two more key features of programming in Ruby: variables and assignment operators.

Hold My Data for Me, Please.

Image by OpenClipart-Vectors from Pixabay

Ruby, along with other programming languages, makes use of variables. What are variables for? You’ll find that programming tutorials typically describe variables as…


Taking a Cue from a Cereal Commercial

Photo by Sten Ritterfeld on Unsplash

In the late 1980’s and early 1990’s, Kellogg’s ran a series of ads for Corn Flakes that encouraged viewers to “taste them again for the first time.” The ads were of course an attempt to boost the appeal of a well-known but very plain product that faced a host of competitors, which ranged from healthy fare like Shredded Wheat to sugar-laden Lucky Charms. In each ad, a person looks at a bowl of the cereal and expresses skepticism, if not outright disdain, for the seemingly boring flakes. …


Here’s my last post on LinkedIn’s JavaScript assessment.

NSYNC with ASYNC

If you’ve used JavaScript at all, then you’ll be familiar with the <script> tag. Like other HTML tags, it too uses attributes, especially src, which points to an external JavaScript file. Let’s say you come across a script tag such as this:

<script src=”app.js” async></script>

What’s the async all about? This boolean attribute “specifies that the script will be executed asynchronously as soon as it is available,” according to W3Schools.com. A question on LinkedIn’s assessment asks what kind of JavaScript code you can use async for: internal, external, both internal and external…


Welcome back! Ready for some more JavaScript edification? Here’s my next installment on the LinkedIn JavaScript assessment.

What does the ‘fox’ say?

Image by GraphicMama-team from Pixabay

Think you’ve mastered JavaScript arrays? Look over the code below:

var a = [‘dog’, ‘cat’, ‘hen’]
a[100] = ‘fox’
console.log(a.length)

Now, can you guess what will be logged to the console?

The variable a has been assigned the value of an array, whose initial length would be 3. Easy enough. Then they throw us a bit of a curveball on the second line. Can an array with only 3 elements have an additional element with an index set…


Here are a few more questions/topics I came across during my trek through the land of LinkedIn’s JavaScript assessment.

Talkin’ ‘bout My Generator

While studying JavaScript, I’ve seen an awful lot of functions, and I’ve also seen a lot of awful functions (most of them ones that I wrote!). But just when I think I’ve finally mastered the sacred art of the JavaScript function, JavaScript slaps me upside the head with something new and more complex. …


Most of my previous articles focused on questions/topics found on LinkedIn’s HTML and CSS assessments. Now I’m moving on to the JavaScript assessment. As before, I’ll only cover some of the things that you may see on the assessment, but if you’re considering adding the JavaScript skill badge to your LinkedIn profile, these next few articles should prove very helpful.

Object of Your Code

Objects abound in JavaScript. You’re probably familiar with the old-fashioned way of creating an object: an object literal, as in the example below.

var myDog = {  name: “Rudy”,  breed: “Parson Russell Terrier”,  sex: “male”,  age…

Here’s my final post on LinkedIn’s CSS assessment. After this, I plan to write about the JavaScript assessment.

Undercover Elements

CSS allows you to “hide” elements on a web page by setting the display property to none or by setting the visibility property to hidden. One question on the assessment asks what difference, if any, there is between display:none and visibility:hidden. In fact, though both methods conceal elements from view, they don’t work exactly the same way. …


My continuing saga of LinkedIn’s CSS assessment.

Selecting Selectors

One of the first topics you’ll cover as you study CSS is selectors, as these are what enable you to choose which elements to style. There are multiple kinds of CSS selectors, including element, class, id, attribute, pseudo-class, and pseudo-element. This question from the assessment shouldn’t pose any difficulty even for someone fairly new to CSS.

What element(s) do the following selectors match?

  1. .nav {…}
  2. nav {…}
  3. #nav {…}

Though all three examples contain nav in the selector, each has a small but important difference that indicates it would not apply…

Lyndel Barnes

Lyndel holds an MA in English and has worked in customer service, education and insurance. He recently finished Flatiron School's software engineering program.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store