Category Archives: JavaScript

JavaScript codes

JavaScript Reviewer

2 Types: 1. Primitive – numbers, strings, booleans, null, undefined 2. Object Falsy values: 0, -0, NaN, “”, false, null, undefined Check for NaN: if(isNaN(varName)){…} Type Operators: typeof “…” – returns data type instanceof Events: document.getElementById(“id”).onclick = function(){…}; Add Many Event … Continue reading

Posted in JavaScript, Uncategorized | Leave a comment

Examples

Quiz System: code / better code ToDoList App: Watch&Code Drum Kit: code Clock: code Changing CSS Variables: code  

Posted in JavaScript | Leave a comment

Algorithm Scripting

  Check for Palindromes Remove X Elements at the Beginning of an Array Shift Cipher  OR  Time Conversion Count Vowels  count_vowels(“cecilia”); 4 Nearby AZ Roman Numeral Converter Return an Array of all Objects with Matching Property and Value Pairs Replace … Continue reading

Posted in JavaScript | Leave a comment

Best Practices

Always use lower case file names Place <script> before the </body> Declare all variables on top Use var once then comma(,) thereafter when declaring variables Save selections into variables: var $name = $(selector); Reduce activity in Loops code Reduce DOM Access code … Continue reading

Posted in JavaScript | Tagged , , , , , , , , ,

Reviewer

HTML5: link CSS: link Bootstrap: link JavaScript link jQuery: link AngularJS: link Algorithm Scripting: link    

Posted in JavaScript | Leave a comment

ES6

Declarations let & const – scoped to the nearest block and are not hoisted let – can be reassigned but cannot be redeclared within the same scope; use in for loops const – cannot be assigned a new value; must be assigned an initial … Continue reading

Posted in JavaScript | Leave a comment

JavaScript Reference

JavaScript Cheat Sheet: http://overapi.com/javascript JavaScript Snippet: http://www.javascriptkit.com/cutpastejava.shtml Namespaced Template: https://css-tricks.com/snippets/javascript/namespaced-javascript-template/ 2 Types:  1. Primitive – numbers, strings, booleans, null, undefined 2. Object Truthy Value: everything with real value example Falsy values: 0, -0, NaN, “”, false, null, undefined Undefined – variable has not yet … Continue reading

Posted in JavaScript | Tagged , , , , , , , , , , , , , ,

Object

Creating an Object: Object Literal / Object Constructor – example Object Basic Usage: create, access, add, change, delete object Create Object Prototype: Object.create() Object with Array: create, access and add array objects Object Property Access: for loop Accessing Object with Arrays: for / if Adding Content Objects into Object … Continue reading

Posted in JavaScript | Tagged , , , , , , , , , , , , , , ,

Check

Check if Function Exists: https://css-tricks.com/snippets/javascript/check-if-function-exists-before-calling/  

Posted in JavaScript | Tagged