Console cheat sheet for JavaScript developers

Learn how to use the browser console effectively for debugging Image by Ilya Pavlov from Unsplash You can open console by using: Chrome → Ctrl Shift J (on Windows) or Cmd Option J (on Mac) Safari → Option-Cmd-C The console object provides access to the browser’s debugging console. The console object present in the global scope. …

Mastering basic Git commands

Learn the basic git commands needed for your daily life. Image from Unsplash(Yancy Min) Create a new local repository. git init 2. Clone a remote branch into your machine. git clone “repository url” 3. List all local branches. git branch 4. List remote and local branches. git branch -a 5. Switch to an existing branch. git …

Short intro about string functions in JavaScript

Learn about available JavaScript string functions. Image taken from unsplash String Properties 1.length var str = “Jagathish”;str.length; //9 –> returns the length of the string Functions toUpperCase() –> returns the new string in uppercase format of source string var str = “Jagathish”; var str2 = str.toUpperCase(); console.log(str);//Jagathish console.log(str2);//JAGATHISH 2.toLowerCase() –> returns the new string in lowercase …

How to Use Object.keys in JavaScript

Consider an object: var user = { name: “Jagathish”, age: 20} In the user object, the name and age are the keys of the object. Keys are also referred to as object “properties”. We can access the property value by obj.propertyName or obj[propertyName]. The Object.keys() method returns an array of strings of a given object’s …

List of most useful websites for everyone.

This is a list of useful websites which everyone should know. 10 minutes mail → provides free, anonymous, secure, temporary email accounts. 30 sec code → Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less. fast.com → Find the speed of the internet Auto draw → AutoDraw is a …

Five Ways to Reverse an Array in Javascript

We can reverse an array by both modifying the source array or without modifying the source array. We will look at different ways to do each. Reversing an array by modifying the source array We can use the reverse method available to JavaScript arrays. var numbers = [ ‘1️⃣’ , ‘2️⃣’, ‘3️⃣’, ‘4️⃣’, ‘5️⃣’ ];numbers.reverse();console.log(numbers); // …

Ternary operator in Javascript

Learn about how and when to use ternary operator in Javascript Ternary operator in Javascript Ternary operator is also denoted as conditional operator. Ternary operator is the compact version of if statement. If you’re going to check for simple condition, then ternary operator is highly recommended instead of if block. Example of using normal if …

Default Parameters in Javascript

Learn about how and when to use default parameters in Javascript. default param Default parameter in Javascript The default parameter is a way to set default values for function parameters a value is no passed in (ie. it is undefined). In a function, Ii a parameter is not provided, then its value becomes undefined. In …

var vs let & const in Javascript.

The Key Difference var is function scoped.let and const is block scoped. Let’s see what this means. Function Scope Function scope means if we declare a variable with the var keyword then the variable is accessible for the lifetime of the function inside the entire function in which it is declared. Example: function test() { …

Secrets of Logical ️ Operators in Javascript 🤷‍

Learn how logical operators in Javascript is different from other programming languages (&& || !) Logical operations allow us to make decisions (either true or false ), based on conditions. In most programming languages, the logical operation returns either true or false. In Javascript, logical operations return the value of one of the operands used in …

Design a site like this with WordPress.com
Get started