Wednesday, June 7, 2017

Array Map, Filter, Reduce methods (Array mfr in short)

Use map when you want to change each value in the array based on some logic

var mappedArray = [2,4].map(number => number * 2)

console.log(mappedArray)


Use filter when you want filter out some values from an array based on some logic

var filteredArray = [1,2,3,4].filter(number => (number % 2 === 0))

console.log(filteredArray)


Use reduce when you want to reduce an array into a single resulting value

var reducedArray = [1,2,3,4].reduce((total,number) => total + number, 0)

console.log(reducedArray)

Cute reference: https://medium.com/@joshpitzalis/the-trouble-with-loops-f639e3cc52d9

Tuesday, April 25, 2017

Slideshow Using CSS and jQuery

I was looking for a simple solution to implement the slideshow of the images in one of my web sites. Found a simple solution here: https://css-tricks.com/snippets/jquery/simple-auto-playing-slideshow/. Simple and elegant!

Monday, April 3, 2017

Stock Market: Short Selling

In terms of Stock Market...Short selling is borrowing the shares from a company, and sell them &&& when the share prices are low, buy them from market and give them back to that company. Since you sold the shares at a high price and bought them at a low price and gave them back, you get to keep the difference.

Read this interesting article on TradeKing.


Wednesday, March 15, 2017

Responsive Web Design

Three things to be considered for Responsive Web Design:
  1. Fluid layouts
  2. Fluid Images
  3. CSS Media Queries
And I come across this nice web site where the author has explained all three of them with a simple example. A very nice job.

http://www.entheosweb.com/website_design/responsive_web_design.asp