JavaScript Prompt Function

  Рет қаралды 12,711

MisterBrash

MisterBrash

Күн бұрын

Пікірлер: 10
@abenezertadesse-l6g
@abenezertadesse-l6g 3 ай бұрын
nice bro keep it up😘😍
@AL-hk3oo
@AL-hk3oo 2 жыл бұрын
nice video, exactly what I'm looking for
@phan4842
@phan4842 10 ай бұрын
man thats a great video, deserves a like!
@ginstones4252
@ginstones4252 2 жыл бұрын
Can I please get the link of the next video you are referring to?
@MisterBrash
@MisterBrash 2 жыл бұрын
I don't believe I ever made a follow-up video to this one. This was a video I made for a class back in 2020 but essentially you want to use an if-statement and the isNaN( ) function. The isNaN( ) function will return TRUE if the input is NOT a number. A bit confusing, but let's say you have a variable "input" and you want to know if the variable is NOT a number - you have two choices (there are more but these are easy). Option A: if (typeof input != 'number') this will return true if the variable is NaN. Option B: if (isNaN(input)) This does the same thing. Seeing code like this in a KZbin comment is difficult, I know, but do some Googling for isNaN( ) and using if-statements to check if a variable is a number or not.
@benzona1503
@benzona1503 2 жыл бұрын
clean af 🤌
@yayeettt
@yayeettt 3 жыл бұрын
in short use parseInt :D
@MisterBrash
@MisterBrash 3 жыл бұрын
Sure - but this was for my intro to programming class that I teach at a high school (14 years-old). So we take it very slowly and learn in small chunks. This particular video was specifically in response to some questions I was receiving as we learned how to receive input from the user. Now in terms of your comment about "just use parseInt" that's also not exactly true because it would depend on what you are trying to gather from the user. For example - what if you don't specifically want a whole number? What if you are allowing decimals? People who know JavaScript tend to say "Just do this" but it doesn't explain WHY. The goal when teaching someone is not to give blanket "just do" statements. It's important that people understand the WHY or they'll just use that thing and not really understand the point behind it.
@yayeettt
@yayeettt 3 жыл бұрын
@@MisterBrash oh yeah I totally understand tho i have teacher that does that 🤔
@osmalflopez8877
@osmalflopez8877 11 ай бұрын
True teacher response. My math teachers hated me for asking why to everything, but that's the only way to truly understand what you're doing and actually learn.@@MisterBrash
JavaScript Functions Crash Course
1:36:54
freeCodeCamp.org
Рет қаралды 187 М.
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 27 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 45 МЛН
How to take User Input using Prompt Sync in JavaScript Node JS
9:04
Example Program
Рет қаралды 52 М.
Javascript Tutorial - Using the prompt() and Number() functions
5:34
Sabotage in the Baltic Sea
11:30
NEXTA Live
Рет қаралды 568 М.
Getting User Input | Javascript | Tutorial 9
4:44
Giraffe Academy
Рет қаралды 173 М.
How to do JavaScript Popups (alert, confirm, prompt examples)
9:46
Tony Teaches Tech
Рет қаралды 79 М.
Javascript - 'prompt' ֆունկցիա
7:50
meschian
Рет қаралды 53 М.
5 Tips for Writing BETTER For Loops in JavaScript
16:15
James Q Quick
Рет қаралды 70 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Урок JavaScript №7 - Консоль и prompt/confirm | Курс FrontEnd 2021
12:48
Фронтенд от Палыча
Рет қаралды 3,7 М.
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 27 МЛН