The JavaScript map()method creates a new array with the results of calling a provided function on every element in this array. For example, lets say you have a small array of numbers called “numbers”: var numbers = [1, 4, 9]; We can use .map on this array to find the square root of each of … Continue reading JavaScript: How to use the array.map( ) method
JavaScript Language
Meteor: How to install Meteor and get a project started in less than 5 minutes
In this article, I want to detail how to install Meteor and get a project quickly up and running. Step 1: Install Meteor In order to install Meteor, the first step according to the installation instructions is to install a tool called “chocolatey”. https://chocolatey.org/install This can be installed with a cmd.exe command. Once that … Continue reading Meteor: How to install Meteor and get a project started in less than 5 minutes
React: How to use CSS in React
In this article I will describe two ways to use CSS in React. Option 1: Inline Define CSS styles ‘inline’ inside React. This uses the props key ‘style’, which uses a dictionary to define all of the CSS attributes. However, these CSS attributes have differences from normal CSS. For example, 1. The attribute names must … Continue reading React: How to use CSS in React
React: How to create the simplest app using Atom
This article is a continuation of the previous article where I created the simplest possible React app in Codepen: React.js: How to create the simplest app using Codepen A second way to create React apps is to use a text editor such as Atom, and reference the necessary resources via CDNs (content delivery networks). In … Continue reading React: How to create the simplest app using Atom
React: How to create the simplest app using Codepen
One easy way to create React apps is to use Codepen. Using Codepen to practice creating React apps requires you to first set some JS settings. The JavaScript Preprocessor should be set to Babel because we will be using JSX instead of pure JavaScript. The Quick-add select menu can be used to select both the … Continue reading React: How to create the simplest app using Codepen
React: Introduction to the main concepts
React is a JavaScript library for building user interfaces, specifically, single page applications (SPAs). It is more of a library than a framework. In the MVC (Model View Controller) paradigm, React takes care of the View. It is in charge of rendering a new view (either by rendering new HTML or changing CSS) in response … Continue reading React: Introduction to the main concepts
JavaScript: How to generate an array of random numbers
Let’s say I want to create a list of 10 numbers that are between the values of 0 and 1. This can be done with a simple for loop. For example: let length = 10; let max = 1; let randArray = []; for (i=0; i < length; i++) { randArray.push(Math.random(max)); } console.log(randArray); Setting the … Continue reading JavaScript: How to generate an array of random numbers
JavaScript: How to use the conditional ternary operator
In addition to “normal” comparison operators (see the links below), JavaScript has a unique comparison operator that can assign values rather than just return a boolean true or false. This is called the “Conditional (Ternary) Operator”. It follows this syntactical construction: variablename = (condition) ? value1 : value2 The question mark means: If the condition … Continue reading JavaScript: How to use the conditional ternary operator
JavaScript: How to use gulp-watch
Assuming Gulp is already installed for your project, and your gulpfile.js file is already created, this article describes how to use the gulp-watch plugin. Here is what tutorialspoint.com says about gulp-watch: The Watch method is used to monitor your source files. When any changes to the source file is made, the watch will run an … Continue reading JavaScript: How to use gulp-watch
JavaScript: How to create Gulp tasks
Once we’ve confirmed that Gulp is installed in our project: JavaScript: How to install Gulp via NPM we are ready to start using Gulp to see what it can do. Step 1: Create a gulpfile.js file In the root directory of our project, we need to create a file called “gulpfile.js”. This file will contain … Continue reading JavaScript: How to create Gulp tasks