Skip to content

Instantly share code, notes, and snippets.

@klockey
Last active March 22, 2017 16:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klockey/e32a5cc6fd426192e8ec4472f1d7fa7b to your computer and use it in GitHub Desktop.
Save klockey/e32a5cc6fd426192e8ec4472f1d7fa7b to your computer and use it in GitHub Desktop.
Description of Javascript

Javascript is exciting because of its ability to manipulate and control aspects of the user experience of the web. It is a lightweight scripting language that will control the html elements and css selectors. Every website you go to probably has some javascript working in the background on the browser.

Web Development is powerful because it contains two components. A front end which houses Javascript and a backend which holds a backend language such as php, Java or Ruby. The back end languages typically manipulate important information to be stored in a database like MySql. They are more concerned with moving data backward to the database and forward to the browser. The front end manipulates data at end user level and then might pass the data back to the backend.

Java script has some very interesting things in its language. For example if you write a variable in a function without declaring it, it is considered a global variable. Unlike other languages, === means that two variables are equal whereas most languages use ==. If you don’t initialize a variable then it is undefined and we can test if the variable is undefined. Most languages only use the keyword NULL. For the declaration of arrays, you can write one of the elements as an empty space. That means the array can grow in size dynamically making its performance very fast.

As illustrated in this essay, one can see the ways Javascript breaks from the norm and also adopts some very fundamental ways that are part of any core programming language. These constructs lend themselves to the power and lighweight aspect of the language.

for (let i = 1; i < 101; i++) {  
  if ((i % 3 === 0) && (i % 5 === 0)) {
    console.log('FizzBuzz')
  }
  else if (i % 3 === 0) {
    console.log('Fizz')
  }
  else if (i % 5 ===0) {
    console.log('Buzz')
  }
  else {
    console.log(i)
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment