What is this line of code

Alex Lord
Alex Lord used Ask the Experts™
 var formData = new FormData();

Open in new window

Cant seem to find what this is on the web,

anyone explain this statement and how to debug and see its values?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
FormData is a class. You are creating  an instance of this class here. However, this class can be anything, as designed and defined by the person that wrote that code. It is not a standard Javascript class, this is a user defined class. Given just this line of code, one cannot describe what it does as that is requires a better understanding of the entire context.

var formData => defining a variable called "formData"
new FormData() => creating an object of type "FormData" (we do not have the definition of this type from your snippet)

To view what this contains, if you are using Chrome for example, you can set a breakpoint and use the console to inspect this variable. You can find many online and video tutorials how to accomplish this online. You can start here: https://codeburst.io/learn-how-to-debug-javascript-with-chrome-devtools-9514c58479db?gi=6df0688c0ff1


thank you Mlanda

i haven't defined it i just came across it in example and wondered what it was.

but thaxs for ur explation and link

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial