All in one place to develop new skills in web development. You can find posts by categories, interview questions, quizzes, and a lot more and in a simplified manner.

Copyright @2019-2020 © by Vinod Kumar. All rights reserved.

Sunday, May 17, 2020

Javascript: Array Methods


Let's look into the complete list of methods available on the array.

  1. Length
  2. IndexOf (Back -negative, no start index
  3. Includes 
  4. LastIndexOf
  5. Search
  6. Slice - Negative (if index value is not included) 
  7. substr - Length
  8. SubString
  9. repeat (ES6)
  10. left/start Trim
  11. right/end Trim
  12. toString
  13. replace
  14. split
  15. concat
  16. charAt
  17. charCodeAt
  18. fromCharCode
  19. touppercase
  20. toLocaleUpperCase
  21. toLowerCase
  22. toLocaleLowerCase

Difference between 

1. includes and indexOf - boolean and number
2. Index of and search - Noregex and regex

Sunday, May 10, 2020

What is DENO ? kick-start tutorial



The person behind Deno is "Ryan Dahl", creator of Node.js. let us check out why did he create Deno.

Node js - It is an open-source, cross-platform, javascript runtime based on the V8 javascript engine.
In his talk, he explains "10 things I regret about Node.js". I will give just mention the points but still if your interested just check out the video.

Points from the talk:
  • Not sticking with promises
  • Security
  • The build system (GYPc)
  • Package.json
  • node_modules
  • Require without extension
  • index.js
  • Focused on an event I/O

Deno - A secure Typescript runtime based on the v8 javascript engine and Rust programming language.
It is a new way to write server-side javascript. It solves all the problems mentioned by Ryan over his talk.
It used the V8 engine under the hood but the runtime is implemented in typescript and Rust.

  • Security (--allow-net, --allow-write)
  • Simplified module system (remove the dependency of node_modules)
  • Typescript compiler built into the executable
  • Ship only single executable with minimal linkage
  • Bootstrap runtime by compiling node modules with parcel into a bundle
  • support for top-level await.
  • Browser compatible('window' not 'global')

I recommend watching this below video - Deno in 100 seconds. 
That's it. Github link

Saturday, May 9, 2020

NG: Setup local environment and workspace


Today we will discuss how to set up a local environment. This is pretty basic for developers who are working on angular applications but will discuss in detail setting up the workspace, projects and if possible we will discuss how to build and deploy, if not we will discuss in the next blog post.

We can set up the application using local development or a tool like stackblitz. 

So let on focus on setting up locally in our machine.

Steps:
1. Install Node (check version using: npm -v)
2. Node comes with a package manager which will be helpful to download dependent packages for our application (check version using: npm -v)
3. Install Angular CLI (command line Interface for scaffolding the application (ready-made application)).
        npm install -g @angular/cli 
4. To create a new workspace and initial app, you will be asked for prompts just accept the defaults by pressing the Enter key (More on prompts later)
        npm new <appName> 
5. Run the application, CLI includes a built-in server to serve the app locally and it supports building, testing, bundling, and deployment of the application.
    More on CLI commands(here).
        cd <appName> 
        ng serve --open