This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Student= function (name,age){ | |
this.name=name; | |
this.age=age; | |
this.showStudentInfo= function (){ | |
console.log(this.name,this.age); | |
} | |
} | |
let std= new Student("labib",23); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isValid=function(){ | |
return false; | |
} | |
function GetStudentList(isValidFuncAsParam){ | |
if(isValidFuncAsParam()===true){ | |
return ["labib","jinnah"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetStudentIdByName(name){ | |
console.log(this); | |
function getname(){ | |
console.log(this) | |
console.log(name) | |
} | |
getname() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOM from 'react-dom'; | |
import React from 'react'; | |
import App from './components/app'; | |
import ReduxPromise from 'redux-promise'; | |
import reducers from './reducers/StoreState'; | |
import {Provider} from 'react-redux' | |
import {createStore,applyMiddleware} from 'redux'; | |
const createStoreWithMiddleware=applyMiddleware(ReduxPromise)(createStore); | |
ReactDOM.render(<Provider store={createStoreWithMiddleware(reducers)}> | |
<App/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "reatwebpacksetup", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "webpack-dev-server --mode development --hot --open", | |
"build": "webpack --mode production" | |
}, | |
"author": "hira hasan", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {mongoose} = require('./mongoconnect'); | |
const User=mongoose.model('Users',{ | |
name:{ | |
type:String, | |
required:true, | |
minlength:2 | |
}, | |
age:{ | |
type:String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactDOM from 'react-dom'; | |
import React from 'react'; | |
import App from './components/app'; | |
import ReduxPromise from 'redux-promise'; | |
import reducers from './reducers/StoreState'; | |
import {Provider} from 'react-redux' | |
import {createStore,applyMiddleware} from 'redux'; | |
const createStoreWithMiddleware=applyMiddleware(ReduxPromise)(createStore); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import ReactDOM from 'react-dom'; | |
import ReactQuill, {Quill, Mixin, Toolbar} from 'react-quill'; | |
export default class TextEditor extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
text: '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {mongoose,ObjectID} = require('mongoose'); | |
const {User} = require('../DB/MODEL/user'); | |
module.exports=function(app) | |
{ | |
app.get('/api/getusers',(req,res)=>{ | |
User.find().then((data)=>{ | |
res.send({data}); | |
},(err)=>{ | |
res.status(404).send(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "reactexpress", | |
"version": "1.0.0", | |
"description": "Simple starter package for Redux,React, Babel , Webpack , node js , mongo , mongose , Express js , Bootstrap", | |
"main": "index.js", | |
"repository": "", | |
"scripts": { | |
"start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js", | |
"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive ./test", | |
"test:watch": "npm run test -- --watch" |