Sign in

Kayla Budzeak
JavaScript Events
JavaScript Events

Have you ever wondered what happens when you click on something in your browser? Like, when you click on a picture and something pops up on the screen? This is an example of a JavaScript Event!

JavaScript gives our browser the ability to “listen” for things (events) that happen within it. These events then trigger some kind of work, such as a function, to occur when they are detected.

Some of the more common events are what are classified as mouse events, like 'click', 'scroll', 'right-click', or even 'mouseover'. Other common events include keypress events and form submissions.

Title: Ruby for Loops
Title: Ruby for Loops

Loops tell our program to do something over and over; imagine hitting replay/repeat on your favorite song.

Syntax:

for [variable] in [expression]
[code]

end

Using the above syntax our program will execute our [code] once for each element in our [expression]. For example, if we have our expression defined as a range of 1 to 7, our for loop will execute our code 7 times, using our variable as a placeholder for each element (number) in our range as it goes through.

for i in 1..7 if i == 1 puts "I've looped 1 time!" elsif i >= 2 puts…

Data types tell your program how to handle what it is that you are telling it to do. Each data type has its own “rules” and is handled in its own specific ways. So let’s dive into each of the data types!

Numbers

There are a couple of sub-types of numbers called integers and floating-point.

Integers are simply numbers without a decimal point and can be either Bignum or Fixnum depending upon the size of the number, however, 99.99999% of numbers you will most likely be handling will be fixnum.

Kayla Budzeak

I'm a Full-Stack Software Engineer, with a background in customer service, who recently graduated from Flatiron School. In my down time I love to bake & garden.

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