Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

reactt split a value and sepate

state = {
   codes : {
    first: "test-123",
    second: "second-6" ,
    seconds: "bet-80",
    days: "4-7"
   }
  }
  render(){
    const {codes} = this.state
    let first,second
    const render =  Object.keys(codes).map((key) => [
    <>
    <label>{key} </label> 
    <label>{first = codes[key].split('-')[0]}</label> 
    <label>{second = codes[key].split('-')[1]}</label> 
    </>
    ])

  return (
    
  <>{render}</>
  );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: create index mongodb 
Javascript :: to do list app react code 
Javascript :: upload multiple image using jquery 
Javascript :: #{} js 
Javascript :: how to push in object in javascript 
Javascript :: how to check popup is open or not in javascript 
Javascript :: javascript Sum of all the factors of a number 
Javascript :: d3.js click event 
Javascript :: js backtick new line 
Javascript :: chess.js 
Javascript :: json.parse 
Javascript :: iis express gzip 
Javascript :: GoogleMap: center or defaultCenter property must be defined 
Javascript :: expressjs param 
Javascript :: product 
Javascript :: classic asp json multidemsion json 
Javascript :: js text match 
Javascript :: javascript sanitize html 
Javascript :: javascript substr 
Javascript :: javascript sort 2d array 
Javascript :: jquery daterangepicker using moment 
Javascript :: return new Promise(res = { 
Javascript :: vue for start at index 
Javascript :: javascript select letter in string 
Javascript :: How to loop through an object in JavaScript with the Object.keys() method 
Javascript :: express sendfile root path 
Javascript :: what is browse router 
Javascript :: javascript nullish 
Javascript :: send sms with twilio 
Javascript :: js example 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =