Skip to content
Advertisement

Convert es6 string in dot into an formData key

Given a JS string

JavaScript

how can I convert the string to formData key notation so I can go

JavaScript

I try this but I want short code with regular expression

JavaScript

Advertisement

Answer

Can do this with a simple split() and reduce()

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement