Posts

Showing posts from June, 2023

react todolist

  import   React , {  useState  }  from   'react' import  {  TextField , Button  }  from   '@mui/material' ; import  {  MdDelete , MdDensityMedium  }  from   "react-icons/md" ; // import ShowList from './ShowList'; export   default   function   Todo () {      const  [ item , setItem ]= useState ([]);      const  [ input , setInput ]= useState ( '' );      const   Additem =() => {          // console.log(input);        setItem (( prevItem ) => {        return  [ ... prevItem , input ];       });        // console.log(item);        setInput ( '' );     }  ...

holding previous value in array react js

const   Additem =() => {          // console.log(input);        setItem (( prevItem ) => {        return  [ ... prevItem , input ];       });        console . log ( item );        setInput ( '' );     } .... 

javascript interview questions_1

 Q1:- var a=2; function display(){     debugger;     console.log('good morning');....callstack } display(); console.log(a); Q2:- var a=2; console.log(show);.....memory? debugger; function display(){         console.log('good morning'); } var show=()=>{     console.log('good night'); } display(); console.log(a); q3: var a=2; display(); showData(); console.log(a); function display(){  a=20;     console.log(a);..... } function showData(){     a=200;     console.log(a);.... } q4: var a=2; display(); showData(); console.log(a);...... function display(){  var a=20;     console.log(a);..... } function showData(){    var a=200;     console.log(a);..... } q5: function a(){     console.log(b); } var b=10; a(); b=? q6: let a=10;     var a=10; error :--     SyntaxError: Identifier 'a' has already been declared q7: const b=10; b=2; TypeError: A...

searchingwithjsondatareact1

 searching: import   React ,{ useState }  from   'react' import   CustomData   from   './MyData.json' import   MyTable   from   './MyTable' export   default   function   Getjson () {      const  [ name , setName ] =  useState ( "" ); // console.log(CustomData); const   SearchData =( CustomData ) => {      console . log ( name );      // const result=CustomData.filter(e=>e.name===name);      const   result = CustomData . filter ( e => e . name . toLowerCase (). includes ( name )|| e . age === parseInt ( name ));      // console.log(result);      return   result ; }; // SearchData();    return  (      < div >          < input   type = "text"   nam...

searchingwithjsondatareact

 MyData.json: [         { "name" : "Ram" ,  "email" : "ram@gmail.com" ,  "age" : 23 },         { "name" : "Shyam" ,  "email" : "shyam23@gmail.com" ,  "age" : 28 },       { "name" : "John" ,  "email" : "john@gmail.com" ,  "age" : 33 },         { "name" : "Bob" ,  "email" : "bob32@gmail.com" ,  "age" : 41 }    ] GetJson.jsx: import   React ,{ useState }  from   'react' import   CustomData   from   './MyData.json' import   MyTable   from   './MyTable' export   default   function   Getjson () {      const  [ name , setName ] =  useState ( "" ); // console.log(CustomData); const   SearchData =( CustomData ) => {      console . log ( name );   ...

searchwithapireact

 blog.jsx import React , { useState , useEffect } from 'react' import axios from 'axios' ; import Table from './Table' ; export default function Blog () {     const [ data , setdata ] = useState ([]);     const [ name , setName ] = useState ( "" );     useEffect (() => { axios . get ( `https://jsonplaceholder.typicode.com/posts` ). then ( res => {     console . log ( res . data );     setdata ( res . data ); }). catch ( err => {     console . log ( err ); })     },[])     const search = ( data ) => {       console . log ( name );       return data . filter (( item ) => item . title . toLowerCase (). includes ( name ))     }   return (     < div >       < input type = "text"   value = { name }           onChange = { ( e ) => setName ( e . target . value ) } ...

ToDolist javascript

html: <! DOCTYPE   html > < html   lang = "en" > < head >      < meta   charset = "UTF-8" >      < meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      < meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      < title > Document </ title >      < style >        ul   li   span {              position :  relative ;              left :  20vw ;              font-size :  20px ;         }          ul   li   span:hover {    ...

node js connectivity and schema

 https://www.topcoder.com/thrive/articles/how-to-connect-mongodb-to-node-js-using-mongoose https://linuxhint.com/define-models-on-nodejs-server/#:~:text=The%20model%20you%20define%20in,data%20to%20look%20and%20behave.

Codingnitor

  How to remove the public folder path from URL in CodeIgniter 4 (studentstutorial.com) it was not need to change:--- public $baseURL = 'http://localhost:8080/' URL Segment Tutorial in CodeIgniter 4 | About URI Segments (onlinewebtutorblog.com) How to add CSS and JS files in Codeigniter 4 | Shekz Tech https://stackoverflow.com/questions/64641808/codeigniter-4-how-to-make-menu-bar-links https://www.youtube.com/watch?v=gOeFGA03Xm4&t=852s