Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

add quotes to array values javascript

dates.map(date => `'${date}'`).join(',');
Comment

add quotes to array items

var array1 = ["test, test1"];

 var array = array1[0].split(',');
array = array.map(i => '"' + i + '"');
alert(array)
 Run code snippet
Comment

add quotes to array values javascript


var dates = ['1/2/12','15/5/12'];

console.log("'" + dates.join("','") + "'");

Comment

PREVIOUS NEXT
Code Example
Javascript :: get selected value in dropdown 
Javascript :: use localstorage hook 
Javascript :: angular pass async pipe value to funciton 
Javascript :: js foreach key value 
Javascript :: react if statement 
Javascript :: how to practice javascript 
Javascript :: javascript array loop 
Javascript :: javascript list class properties 
Javascript :: javascript formdata 
Javascript :: jscrollpane set background color 
Javascript :: react setstate in another component 
Javascript :: jquery event methods 
Javascript :: The slice JavaScript string method 
Javascript :: async map js 
Javascript :: javascript alert variable 
Javascript :: regex match first result only 
Javascript :: vue component lifecycle 
Javascript :: javascript date validation less than today 
Javascript :: module.exports multiple functions 
Javascript :: postman environment variables 
Javascript :: find duplicate element on array 
Javascript :: react loop through array 
Javascript :: function to count words in string 
Javascript :: nuxt 3 font awesome 
Javascript :: convert a string array into object using kerys 
Javascript :: onclick node js 
Javascript :: tricky javascript interview questions 
Javascript :: js round 2 decimals 
Javascript :: how to create a slice of the array with n elements taken from the beginning in javascript 
Javascript :: jquery select2 multiple select all 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =