Whether you’re a React.js, Angular, Vue.js, or simply a front-end developer, your code can be an inviting door for hackers.
As a front-end developer, we’re mostly concern about performance, SEO, and UI/UX — security is often overlooked.
You might be surprised to know how big frameworks let you open yourself up to cross-site scripting (XSS) attacks. There are risky operations names like
dangerouslySetInnerHTML in React or the
bypassSecurityTrust APIs in Angular.
We should keep in mind that the front end now shares equal responsibilities as the back end or DevOps in terms of security. …
The v8.0 release with some new features — optional chaining, Nullish coalescing, faster higher-order builtins and 40% less memory use thanks to pointer compression, these features and changes will improve the performance and code productivity.
Let’s see them one by one —
When accessing the nested object properties we need to do a manual check for properties existence, i.e., if they are nullish (
undefined) or not.
// Error prone-version, could throw.
const nameLength = db.user.name.length;TypeError: Cannot read property 'length' of undefined, if user is nullish
TypeError: Cannot read property 'property name' of undefined. …
The Console API’s most commonly used method is undoubtedly
console.log. However, it also comes with several other useful methods that can improve our debugging efficiency.
Let’s dive in 🏊 and understand some of the other methods👇
Note: All methods are available in NodeJS as of version 10.0.0 and in almost every major browser.
While debugging, if there is a complex nested object or an array of objects of the same type, we face difficulty in reading, understanding, and comparing objects.
console.table() is here to rescue us. It presents the data in a clear tabular format. Hence, improving the readability.
The method takes two…
This article hopes to help people using VS Code to code even faster.
Not everyone has time to go through every tip and trick to find the ones that help them code faster — there’s just too many.
So I’ll list my favorite shortcuts that make me a fast coder.
Keyboard shortcuts, and bind
editor.action.joinLinesto a shortcut of your choice.
This shortcut helps to indent the code as already set up in the editor settings.
Tip: Use this in the end or the start. I prefer using it when I’m done with the code in a file. …
In this article, we will learn about face detection (Age/Gender/Face Positions/Mood) using
face-api.js and the nearby object detection (Person/Phone etc) using
coco-ssd model on the web browser.
Let’s start now,
npx create-react-app object_face_detection
npm install @tensorflow-models/coco-ssd
npm install @tensorflow/tfjs-converter
npm install @tensorflow/tfjs-core
npm install face-api.js
npm install p5
In this article, we will see some of the presents and purposed features that you can test in chrome browser (version ≥76) or Node.js(version …
For those who don’t already know, Visual Studio is a full-featured and convenient development environment.
VS Code is an open-source, cross-platform source code editor that’s become famous, particularly in the web development community. It’s fast, extensible, customizable, and has tons of features.
I’ve been using VS Code for a long time. Being a full-stack developer, I’ve tried a lot of extensions. …
undefined, strings, numbers, boolean, and symbols. These are called primitive values or primitive types.
Anything that is not a primitive value is an Object. That includes arrays, functions, constructors, and objects themselves.
Yes! Functions and arrays are objects too as we shall see later in the article.
Conceptually, Objects are the same in all programming languages i.e they represent real-world things that we want to represent inside our programs with characteristics/properties and methods.
For example, if your object is a student, it will have properties like name, age, address, id, etc and methods like
Functions that can return multiple values at different time interval, as per the user demands and can manage its internal state are generator functions. A function becomes a GeneratorFunction if it uses the
They are different from normal functions in the sense that normal function run to completion in a single execution whereas generator function can be paused and resumed, so they do run to completion but the trigger remains in the developer’s hand. They allow better execution control for asynchronous functionality but that does not mean they cannot be used as synchronous functionality.
Note: When generator function are executed it returns a new Generator object. …
This is the fourth post of the image processing series from zero to one.
Here is the list of other posts
In this post, we will build an image object detection system with Tensorflow-js with the pre-trained model.
To start with, there are lots of ways to deploy TensorFlow in webpage one way is to include ml5js. Visit https://ml5js.org/. Its a wrapper around tf.js a tensor flow and p5.js …