New Videos Coming in January 2022 – Clear Google Cloud Digital Leader Certification

New Videos Coming in January 2022 – Clear Google Cloud Digital Leader Certification

New videos and posts are coming in January 2022 where I will be sharing everything you need to know to clear the Google Cloud Digital Leader Certification.

It will be individual videos covering every aspect of the certification.

Please subscribe to my Youtube Channel and my blog below to get updates about all the upcoming videos and posts.

Down Arrow

Comments

Top JavaScript Console Features

Top JavaScript Console Features

When learning a new programming language, many individuals begin by learning how to create a "Hello World" program.
In JavaScript, you can print messages and other forms of information through the browser's console using console.log statements.

When JavaScript isn't working as it should, one of the most common solutions is to add log statements at various points throughout your programme so you can figure out what's going on.

But trust me, you can do lot of other things with console object other than just logging

The console object includes more than simply log methods, and it can help you improve your JavaScript debugging skills. This blog post is going to cover some of the hidden features from the console object.

Read this blog post or watch the video below to learn about the advanced selectors.

Styling console.log() output

The Console object has some useful capabilities, such as CSS styling. This feature is activated by entering a unique token into the first console.  See the example below

console.log("%cHello World","color:blue; font-style:italic;");

Here I am using the %c to include the CSS styling in the Hello World statement. Resulting output is shown below.

HelloWorldStyle

console.table()

When you have strings, integers, or other primitives, console.log comes in handy.
When you're trying to log an item, an array, or even an array of objects, it becomes less useful.

Rather than merely logging the data, console.table() will organize it into a table, which is usually simpler to read. Let's see the example below

const countries = [
 {
 name: "India",
 capital: "New Delhi"
 },
 {
 name: "Canada",
 capital: "Ottawa"
 },
 {
 name: "Switzerland",
 capital: "Bern"
 },
 {
 name: "United States of America",
 capital: "Washington, D.C."
 },
];
console.log(countries);

If I use console.log to print the content of the array "countries", it will be printed like this which is definitely not very easy to understand.

Let's use console.table() instead of console.log and you will see that contents will be displayed in table format which is very easy to visualize and also you will get the advantages of doing sorting on each column inside the table.

const countries = [
 {
 name: "India",
 capital: "New Delhi"
 },
 {
 name: "Canada",
 capital: "Ottawa"
 },
 {
 name: "Switzerland",
 capital: "Bern"
 },
 {
 name: "United States of America",
 capital: "Washington, D.C."
 },
];
console.table(countries);

console.groupCollapsed()

The console.groupCollapsed() function is an inbuilt method for collapsing grouped content until the console.groupEnd() method is called. The collapsed group is started, and the group can be ended with the groupEnd() method. You can give different names to different groups. One thing you need to keep in mind, that whatever name you will give in the console.groupCollapsed() method, you need to the use the same name in console.groupEnd() method as well. Below is the example code snippet.

console.log("Before the group");
console.groupCollapsed("Group for generating randorm numbers");
for(let i=0;i<500;i++){
 console.log(Math.round(Math.random() * 25));
}
console.groupEnd("Group for generating randorm numbers");
console.log("Before the group");
Group

console.time()

When your code performance becomes sluggish and junky, one of the first things you should do is figure out where the performance bottlenecks are.

console.time() and console.timeEnd() can be helful to understand that.

  • console.time() - Starts a timer
  • console.timeEnd() - Stops the timer and logs the execution time.

In the below code, I have used these two methods to calculate the execution time of the for loop.

console.log("Before the group");
console.time("Execution time to generate random numbers");
console.groupCollapsed("Group for generating randorm numbers");
for(let i=0;i<500;i++){
 console.log(Math.round(Math.random() * 25));
}
console.groupEnd("Group for generating randorm numbers");
console.timeEnd("Execution time to generate random numbers");
console.log("Before the group");
Time

Conclusion

This is only a small sample of the console object's capabilities, but these are the ones I use the most on a daily basis.

You can always go to MDN to learn more.

Thank you for taking the time to read this! Stay safe!

Comments

Kitchener Canada Developer Group Event: From Admin to Certified Technical Architect by Johann Furmann

Kitchener Canada Developer Group Event: From Admin to Certified Technical Architect by Johann Furmann

 

 

Special thanks to our speaker, Johann Furmann, for the session on his journey "From Admin to Certified Technical Architect". 

You can register for all the upcoming sessions from the Kitchener Developer Group here.

You can get details (presentation and recording) of all the earlier sessions from the Kitchener Developer Group here.

Recording

Summer ’21 Flow New Features

Summer ’21 Flow New Features

If you are a Salesforce Flow fan, I am sure like me, Summer 21 release is going to excite you as well. In this blog post, I am sharing all the new flow features that are now available with Summer 21 and how we can take advantage of these.

I will be sharing a video as well explaining these features at the end of this post. So if you prefer watching videos, click here or you can continue reading this post first and then watch the video later.

Note – I will be covering Salesforce Summer 21 release new features in upcoming posts. You will be able to get everything related to Summer 21 here –  


So let’s start.

1. Debug Record-Triggered Flow using Flow Debug Tool

After Summer 21 release, we will be able to debug any record-triggered flow using Flow Debug Tool. This is a huge improvement. We just need to select the record and execute the flow in debug mode. Since debugging a flow means executing the flow in rollback mode, so no changes will be saved to the record.


2. Check Governor Limit Consumption and Transaction Boundaries

With Summer 21 release, we can now see the use and consumption of various Governor limits and Transaction Boundaries. This is super helpful to make the flow execution faster by optimizing the flow as per the limits and best practices.

3. IS CHANGED operator in Record-Triggered Flow

With Summer 21 release, we can now use the IS CHANGED operation in Record-Triggered flows. This is another great feature to understand whether a value is changed or not and then execute the flow accordingly. Without this feature, we need to implement multiple checks which can be simplified now with this single operator.


4. Collection Sort within Flow Builder

This is another great addition to flow’s logic elements. We can now sort any collection variables in descending or ascending order. Also, we can choose which field should be used to do the sorting. This is a super powerful feature to make complex flows a little simplified.


5. Include Record Fields directly into the Flow Screen (Beta)

This feature is in BETA stage. With this feature, adding fields in screen elements is becoming super easy. We can add fields associated with a record of sObject by drag-n-drop when using the Fields tab. 


6. Create Multicolumn Screens in Flow Builder (GA)

This feature first came into existence in Sping 21 as BETA and in Summer 21, Salesforce is making it GA. So we can take full advantage of this feature and can also get supports from Salesforce.

To understand how this feature works, please read my earlier post below –

7. Easily get Paused and Failed Flows

Now getting all your paused and failed flows is super easy. Just type “Flows” in quick find and click on “Paused And Failed Flow Interviews”.

As promised at the beginning, below is the video where I have covered all the new flow features from Summer 21 release.

Events in JavaScript

 

What is an Event

An event is a message that is dispatched to the event target. There are various categories of events like user events (‘click’) and system events (‘DOMContentLoaded’) etc.