Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to pass an object directly to formdata in javascript

function getFormData(object) {
    const formData = new FormData();
    Object.keys(object).forEach(key => formData.append(key, object[key]));
    return formData;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how do i get month and date of javascript in 2 digit format 
Javascript :: a cypress command to refresh the whole page 
Javascript :: js console log input value 
Javascript :: pdf dark 
Javascript :: jquery append after 
Javascript :: javascript loop over class 
Javascript :: How to get unix timestamp from tomorrow nodejs 
Javascript :: find a value in an array of objects in javascript 
Javascript :: how to check if a string is correctly encoded as base64 in javascript 
Javascript :: if json then parse 
Javascript :: js open file dialog 
Javascript :: req.body empty mongodb 
Javascript :: Get the value of selected radio button 
Javascript :: add search query in express 
Javascript :: electron download 
Javascript :: jquery delay to call function 
Javascript :: remove all classes jquery 
Javascript :: how to concurrently run angular and node 
Javascript :: shadow border react native 
Javascript :: react native text truncate 
Javascript :: how to use ctrl c and ctrl v using vim vscode extension 
Javascript :: remove falsy values from array javascript 
Javascript :: onclick string 
Javascript :: js bmi calculator 
Javascript :: iterate array javascript 
Javascript :: charcodeat vs codepointat 
Javascript :: pangram javascript 
Javascript :: javascript redirect another page 
Javascript :: string to pascal case 
Javascript :: js is number 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =