Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert array to dictionary

// Convert to array string to dictionary, ex: ['choice_a', 'choice_b'] => {choice_a: true, choice_b: true }
const paramsChecked = Object.assign({}, ...listChecked.map((x) => ({[x]: true})))
Source by kite.com #
 
PREVIOUS NEXT
Tagged: #convert #array #dictionary
ADD COMMENT
Topic
Name
1+8 =