Tuesday, September 26, 2017

JavaScript

JavaScript is a lightweight, cross platform, object oriented programming language.

lightweight: it takes very less system memory

cross platform: can be run on multiple platforms and systems

object oriented : js is a language based on object

JavaScript is one of the three core technologies(HTML & CSS)

JavaScript is most commonly used as a part of webpages. It can be used in different places.
  • Client Side : JavaScript was used only in browser  for many years.
  • Server Side : With development of Node.js we are able to use JavaScript in the server side as well.
JavaScript made modern web development possible. With JS we are able to have dynamic effects and are building modern web applications that we can interact with.

Different states of a PROCESS

As a process executes it changes its state. The state of a process is defined in part by the current activity of that process. A process may be in one of the following states.


  • New : The process is being created.
  • Running : Instructions are being executed.
  • Waiting : The process is waiting for some event to occur.
  • Ready: The process is waiting to be assigned to a processor.
  • Terminated: The process has finished execution.

The state diagram gives you the detailed understanding on how the process changes its state.



Monday, September 25, 2017

JSX

JSX - JavaScript Syntax Extension

A preprocessor step that adds XML syntax to javascript.


  • It looks like XML/HTML
  • Defines a familiar syntax to define tree structure with attributes
  • It is not requires but makes things easier while writing react components.

     
The left side represents code written in JSX and right hand side is the corresponding javascript . Just to make a list of four colors you can see the amount of code we have to write if we are not using JSX.

Friday, September 8, 2017

" Hello World ! " using React JS


  • Create a document with .html extension, let it be index.html.
  • Now add title to the web page. In the body section create a div tag with id='app'. We will then write react code which replaces the content here under div tag.

  • Add the react-dom and react js script files to the index.html
  • Add the react js script to be rendered in index.html 
  • Open the index.html in your browser. You should see Hello World! as below.
You have done your first react application

Call a function in child component from parent component in React

Consider the following parent component class Parent extends React.Component { constructor(props) { super(props);         thi...