It is a Freecodecamp Project
A Pen by karthikeyan on CodePen.
| brew update | |
| > brew install libxml2 libxslt libiconv | |
| brew --prefix libxml2 | |
| /usr/local/opt/libxml2 | |
| brew --prefix libxslt | |
| /usr/local/opt/libxslt | |
| brew --prefix libiconv |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <div id="root"></div> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/redux/4.0.4/redux.js"> </script> |
| console.log("data"); | |
| function foo(){ | |
| console.log("foo"); | |
| } | |
| function bar(){ | |
| console.log("bar"); | |
| foo(); | |
| } | |
| bar(); |
| let obj = { | |
| a : 2, | |
| c : function(){ | |
| console.log("Inside the obj the value of a "+ this.a) | |
| } | |
| } | |
| function dummy(callback){ | |
| callback(); |
| let example ={ | |
| a:2, | |
| b:"Example", | |
| c:function(){ | |
| console.log(this) | |
| } | |
| } | |
| example.c() // { a: 2, b: 'Example', c: [Function: c] } |
| a = 4 ; | |
| function c(){ | |
| console.log(this.a) | |
| } | |
| example ={ | |
| a:2, | |
| b:"Example", | |
| c:function(){ | |
| console.log(this.a) // 2 | |
| } |
It is a Freecodecamp Project
A Pen by karthikeyan on CodePen.
| class Clock extends React.Component { // create the Clock component using ES6 class | |
| constructor(props) { | |
| super(props); | |
| this.state = {date: new Date()}; // initalise the state | |
| } | |
| render() { // data to be rendered goes inside the function | |
| return ( /* getting the data from the props */ | |
| <div> | |
| <h2> {this.state.date.toLocaleTimeString()}.</h2> |
| class Clock extends React.Component { // create the Clock component using ES6 class | |
| constructor(props) { | |
| super(props); | |
| this.state = {date: new Date()}; // initalise the state | |
| } | |
| componentDidMount() { /* React Mount -- Setting up the timer when the DOM has been rendered to the screen */ | |
| this.timerID = setInterval( | |
| () => this.tick(), | |
| 1000 |
| //Requiring the package | |
| "use strict"; | |
| let PouchDB = require('pouchdb'); | |
| let db = new PouchDB('test_db222'); | |
| console.log ("Database created Successfully."); | |
| // You can get the basic information about the database using the method named info() |