Template literals

I have to print a message with values of, say, two variables interpolated or inserted in it. I am talking about JavaScript here. What I do is start single or double quotes, write some part of my message string, close the quotes, insert the variable, start quotes for remaining part of the message and keep … Read More

Some methods of arrays

Iteration of arrays can be done via use of a map function instead of using for loops. Given an array, each element of the array is operated upon. Function creates a new array instead of updating the existing one. // Multiply each element of oldArray with 3 to create a newArray var newArray = oldArray.map(function(val) … Read More

Objects in JS

Objects in JS can be created by: Use of variables Use of functions // table variable | // use of function var table = { | var table = function() { “legs”:4, | this.legs = 4; “color”:”brown”, | this.color = “brown”; “material”:”wood” | this.material = “wood”; }; | }; An instance of these objects can … Read More

Hour 2 : JS

Continuing learned using boolean values, conditional statements, switch case and use of functions. Everything goes on like we might have learned in some other language. Encountered only a new operator category called the strict equality operator and strict inequality operator. Strict equality operator uses === instead of the normal == for the equality operator. So … Read More

Hour 1 : JS

Having not used JS even to a novice level, I had planned to learn it and create something substantial. And today was the first day to executing the plan. I will brief out the things I learned in the sequence on a map. undefined, null, boolean, string, number, symbol and object are the 7 data … Read More

Javascript & Django Form

We were assigned the task to use JavaScript in Django forms. Basically, we had to implement three interdependent drop-downs in Django form. Today, we are done with a form where selection of an option in first drop-down enabled the second which on changed enabled the third drop-down. "onchange()" function was incorporated in the template to … Read More
Follow

Get notified with the latest posts

Plugin Supporter WordPress Post Navigation
%d bloggers like this: