What is this line of code

 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?
Alex LordAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MlandaTCommented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alex LordAuthor Commented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.