Prabhu Sunderaraman

Fullstack Engineer, Programmer, Writer, Trainer

prabhu.bits@gmail.com,     GitHub     Youtube     LinkedIn
  • Home
  • Profile
  • Books
  • Reading List
Browsing: / Home
Shortlink

Modern JavaScript concepts you need to know – Template Strings

By Prabhu Sunderaraman on April 23, 2018 in JavaScript

A number of JavaScript libraries these days, require strong understanding of the ES6 language. If you want to comfortably work with libraries like Redux, ReactJS, Relay, GraphQL it’s important to understand some of the latest concepts.

My first article/video in the series talks about Object Destructuring.
The second one, discusses Array Destructuring.
The third topic is on writing relaxed JSON.
The fourth topic is about using Rest operators.
The fifth topic is about using Spread operators.

The topic I have discussed here is Template Strings that allows you to interpolate strings and create multiline strings.

let name = 'Sam'

//Old style
//let message = 'Hi ' + name + '!'

let message = `Hi ${name}!`
let message2 = `Hello ${name.substring(0,1)}!`
console.log(message2);

let multineString = `This
is
a
multiline
string`
console.log(multineString);

let city = 'London'
let msg = `I am in ${city}`//Not lazily evaluated
city = 'Paris'
console.log(msg);

You can watch the video here


Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Modern JavaScript concepts you need to know – Spread operator

By Prabhu Sunderaraman on April 19, 2018 in JavaScript

A number of JavaScript libraries these days, require strong understanding of the ES6 language. If you want to comfortably work with libraries like Redux, ReactJS, Relay, GraphQL it’s important to understand some of the latest concepts.

My first article/video in the series talks about Object Destructuring. The second one, discusses Array Destructuring. The third topic is on writing relaxed JSON. The fourth topic is about using Rest operators.

The topic I have discussed here is Spread Operator that allows you to expand iterables like arrays.

//...Spread operator

let arr1 = [1,2,3]
let arr2 = [4,5,6]

//let numbers = [arr1,arr2]

let numbers = [...arr1,...arr2]
console.log(numbers);

let original = [10,20,30]
let copy = [...original]
copy[0] = 100
console.log(original,copy);

You can watch the video here


Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Modern JavaScript concepts you need to know – Rest operator

By Prabhu Sunderaraman on April 11, 2018 in JavaScript

A number of JavaScript libraries these days, require strong understanding of the ES6 language. If you want to comfortably work with libraries like Redux, ReactJS, Relay, GraphQL it’s important to understand some of the latest concepts.

My first article/video in the series talks about Object Destructuring. The second one, discusses Array Destructuring. The third topic is on writing relaxed JSON. The topic I have discussed here is Rest Operator that allows you to create a function with variable number of arguments.

The topic I have discussed here is Rest Operator that allows you to create a function with variable number of arguments.

let add = function(x,y,...numbers){
//	console.log(arguments);
	let total = 0
	numbers.forEach(num => {
		total += num
	})
	console.log(total);
}

//add([1,2,3,4,5])
add(1,2,3,4,5)

You can watch the video here


Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Modern JavaScript concepts you need to know – Relaxed JSON

By Prabhu Sunderaraman on April 10, 2018 in JavaScript

A number of JavaScript libraries these days, require strong understanding of the ES6 language. If you want to comfortably work with libraries like Redux, ReactJS, Relay, GraphQL it’s important to understand some of the latest concepts.

My first article/video in the series talks about Object Destructuring. The second one, discusses Array Destructuring. And now let’s talk about Relaxed JSON, where working with JSON has become a breeze with minimal keystrokes.


let title = "Programming Ruby"
let price = 12.4

//Old style
// let book = {
// 	title: title,
// 	price: price,
// 	buy: function(store){
// 		console.log("Buying from " + store);
// 	}
// }

//New Style
 let book = {
 	title,
 	price,
 	buy(store){
 		console.log("Buying from " + store);
 	}
 }
 console.log(book);
 book.buy("Amazon")

You can watch the video here


Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Modern JavaScript concepts you need to know – Array Destructuring

By Prabhu Sunderaraman on April 9, 2018 in JavaScript

A number of JavaScript libraries these days, require strong understanding of the ES6 language. If you want to comfortably work with libraries like Redux, ReactJS, Relay, GraphQL it’s important to understand some of the latest concepts.

Here’s my second item in the series of articles with videos on the topics. The second topic is Array Destructuring, where we extract items from an array and assign to variables.

let numbers = [10,20,30]

//Old style
// let a = numbers[0]
// let b = numbers[1]
// let c = numbers[2]

//ES2017
let [a,b,c] = numbers
console.log(a,b,c);

let [i,_,k] = numbers
console.log(i,k);

//Swapping two numbers
var num1 = 100
var num2 = 200

var [num2,num1] = [num1,num2]
console.log(num1,num2);

You can watch the video here


Share this on: Mixx Delicious Digg Facebook Twitter
« Previous 1 … 14 15 16 … 64 Next »

Youtube Channel




Categories

  • JavaScript (48)
    • RequireJS (5)
  • Go (44)
  • Golang (44)
  • Ext JS (23)
  • Spring (22)
  • Mobile (21)
  • Scala (20)
    • Play (3)
  • Uncategorized (19)
  • Video Sessions (18)
  • GoG (17)
  • Sencha Touch (16)
  • jQuery (14)
  • Languages (13)
  • Java 8 (12)
  • React JS (11)
  • Kotlin (11)
  • HealthyCodeMagazine (9)
  • Video (9)
  • Objective-C (8)
  • NoSQL (8)
  • Android (7)
  • MongoDB (7)
  • GWT (6)
  • Tools (6)
  • HTML 5 (5)
  • Cloud (5)
  • General (5)
  • Micro services (5)
  • Java (5)
  • Books (4)
  • AWS (4)
  • Software Architecture (4)
  • .NET (3)
  • Elixir (3)
  • Docker (3)
  • Reactive (3)
  • NodeJS (2)
  • RoR (2)
  • Backbone (1)
  • AngularJS (1)

Archives

  • 2020 (49)
  • 2019 (7)
  • 2018 (34)
  • 2017 (15)
  • 2016 (7)
  • 2015 (18)
  • 2014 (31)
  • 2013 (55)
  • 2012 (100)

Search

Subscribe




Copyright © 2025 Prabhu Sunderaraman.

Powered by WordPress and News.