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

Posted by Cheryll on Mar 30, 2026 at 03:24 PM

Given the following code:

```javascript

var data;

```

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

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

---

Get Premium WGU (KVO1) Web Development Applications Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
PR
Precious 3 months ago
I’m leaning towards A) Undefined too. Null would mean it was explicitly set.
TR
Trina 3 months ago
Agreed! A) Undefined makes sense. It's the default state.
VI
Vivan 3 months ago
I think the answer is A) Undefined. It hasn't been assigned a value yet.
AR
Arthur 3 months ago
An empty string? Nah, that's not it!
VO
Vonda 3 months ago
Null would be a better guess, right?
MO
Mollie 4 months ago
Wait, how can it be undefined?
LA
Lashandra 5 months ago
Totally agree, it's definitely undefined.
VA
Van 5 months ago
It's undefined!
TY
Tyra 6 months ago
I was confused about null and undefined, but I believe undefined is correct here.
JO
Johnathon 6 months ago
This reminds me of a practice question where an uninitialized variable was also undefined. I think that's the right answer.
BA
Barrett 6 months ago
I'm not entirely sure, but I remember something about variables in JavaScript defaulting to undefined.
CH
Chandra 6 months ago
I think the value of `data` should be undefined since it's declared but not initialized.
0/2000 characters

Save Cancel