explained reason for ; before function
updated typecasting and coersion to use toString(); removed boolean typecasting
added  caching to jquery example