Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

WGU (KVO1) Web Development Applications Exam - Topic 3 Question 8 Discussion

Actual exam question for WGU's WGU (KVO1) Web Development Applications exam
Question #: 8
Topic #: 3
[All WGU (KVO1) Web Development Applications Questions]

Given the following code:

```javascript

var data;

```

What is the value of `data` when the code runs?

Show Suggested Answer Hide Answer
Suggested Answer: A

> ''In JavaScript, any variable declared but not assigned a value is automatically set to `undefined`.''

Example:

```javascript

var data;

console.log(data); // undefined

```


* MDN Web Docs: undefined

* JavaScript Guide: Variables

---

Contribute your Thoughts:

0/2000 characters
Lashandra
18 days ago
Totally agree, it's definitely undefined.
upvoted 0 times
...
Van
23 days ago
It's undefined!
upvoted 0 times
...
Tyra
1 month ago
I was confused about null and undefined, but I believe undefined is correct here.
upvoted 0 times
...
Johnathon
2 months ago
This reminds me of a practice question where an uninitialized variable was also undefined. I think that's the right answer.
upvoted 0 times
...
Barrett
2 months ago
I'm not entirely sure, but I remember something about variables in JavaScript defaulting to undefined.
upvoted 0 times
...
Chandra
2 months ago
I think the value of `data` should be undefined since it's declared but not initialized.
upvoted 0 times
...

Save Cancel