How to Benchmark Your Javascript?

This is a quick tutorial on how to benchmark your javascript with console.time(“arg”) and console.timeEnd(“arg”) You would use developer tools to see how fast your script runs. Example Code: Array.prototype.proto1 = function(){}; Array.prototype.proto2 = function(){}; Array.prototype.proto3 = function(){}; Array.prototype.proto4 = function(){}; Array.prototype.proto5 = function(){}; var objectLateral = { arrayBank: [‘Some random string’, ‘Other String’, ‘More…

Building a Calculator With Angular Js

index.html Angular js Simple Calculator Example Code <!doctype html> <html lang=”en”> <head> <meta charset=”UTF-8″> <title>Example – example-example68-production</title> <script src=”//ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js”></script> </head> <body ng-app=””> First Num<input type=”number” ng-model=”number1″> Second Num<input type=”number” ng-model=”number2″> <button ng-click=”count = count + number1″ ng-init=”count=0″> Add </button> <button ng-click=”count = count – number2″ ng-init=”count=0″> Subtract </button> <button ng-click=”count = count * number2″ ng-init=”count=0″>…

Gulp To Create One Javascript File to Speed Up Your Production Server

First install node.js Type this in commandline npm install gulp npm install gulp-concat –save-dev npm install gulp-uglify –save-dev npm install gulp-rename –save-dev ‘use strick’; var gulp = require(‘gulp’), concat = require(‘gulp-concat’), uglify = require(‘gulp-uglify’), rename = require(‘gulp-rename’); gulp.task(“concatScripts”, function(){ //combine all these scripts gulp.src([ ‘js/jquery.js’, ‘js/sticky/jquery.stick.js’, ‘js/main.js’]) //create file .pipe(concat(“app.js”)) // put in folder destination…

How to create a simple calculator program with javascript

This is a tutorial about how to create a simple calculator program with javascript, css, and html. First create index.html file <html> <head> <title>Dice Simulator 2015</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Calculator Example</h1> <p>Open the JavaScript developer console to interact.</p> <script src="calculator.js"></script> </body> </html> Then create style.css file * { font-family: Helvetica, Arial, sans-serif; text-align:…

Create a Dice with HTML, CSS, and Javascript

We are going to create a html, css, and javascript die with this code. For every block of code create the coodinating file extension be it .js .html .css and etc. It should work. Happy coding. First create index.html <html> <head> <title>Dice Simulator 2015</title> <link rel="stylesheet" href="style.css"> </head> <body> <p id="placeholder"> </p> <button id="button">Roll Dice</button>…