Log in Mehul Tandon 4 years agoPosted 4 years ago. Direct link to Mehul Tandon's post “For the first javascript ...” For the first javascript example, and the last pseudocode example, in the print/display statament, the actual expression was written. Can't you just write the variable name to print instead of the whole expression? • (5 votes) pamela ❤ 4 years agoPosted 4 years ago. Direct link to pamela ❤'s post “Ah, I was trying to show ...” From the author:Ah, I was trying to show that the results from calling procedures can be used in multiple ways, but it does indeed look like I'm just ignoring good practices by repeating the expression. I'll try to break that up into separate blocks! (13 votes) mayakotek 4 years agoPosted 4 years ago. Direct link to mayakotek's post “In the article, the funct...” In the article, the function explaining how to calculate an absolute is written like this: • (5 votes) Aryaa 4 years agoPosted 4 years ago. Direct link to Aryaa's post “Yes, both ways are correc...” Yes, both ways are correct. However, in the article, they wrote it out so that it was more understandable by first-time programmers. (5 votes) London Brown a year agoPosted a year ago. Direct link to London Brown's post “What does num means and w...” What does num means and why do the computer provide it? • (3 votes) Abdelrahman a year agoPosted a year ago. Direct link to Abdelrahman's post “`num` is just the name of...” (6 votes) layaz7717 4 years agoPosted 4 years ago. Direct link to layaz7717's post “In the program, why are a...” In the program, why are all the procedures repeated twice? • (2 votes) Shane McGookey 4 years agoPosted 4 years ago. Direct link to Shane McGookey's post “If you are referring to r...” If you are referring to repetition such as: Then it is important to understand that two different actions are happening here. In the first The purpose of doing it this way is to add clarity to the example. Without printing the string literal, you would simply see a succession of numbers, which may be unhelpful. (6 votes) Sienna Hsu 4 years agoPosted 4 years ago. Direct link to Sienna Hsu's post “Is it just me or the equi...” Is it just me or the equivalent Python code of Mathematical Procedures is linked to the wrong webpage? This is the correct link: https://repl.it/@PamelaFox1/MathematicalProcedures#main.py • (3 votes) vivekns007 4 years agoPosted 4 years ago. Direct link to vivekns007's post “I don't see the ← symbol ...” I don't see the ← symbol on my keyboard.How can I type the pseudocode without that symbol? • (2 votes) Martin 4 years agoPosted 4 years ago. Direct link to Martin's post “If you're on windows you ...” If you're on windows you can use alt keys (2 votes) Maxter a year agoPosted a year ago. Direct link to Maxter's post “Does khan academy have th...” Does khan academy have the constant PHI? • (2 votes) Srinivas 4 years agoPosted 4 years ago. Direct link to Srinivas's post “What does the abs1 mean i...” What does the abs1 mean in • (1 vote) Evan 4 years agoPosted 4 years ago. Direct link to Evan's post “abs1 is simply the variab...” abs1 is simply the variable name. You could use whatever name you want, although you should use a name that reminds you of what it's used for. (2 votes) Justin Ussery 6 months agoPosted 6 months ago. Direct link to Justin Ussery's post “Quoted from above-"In Jav...” Quoted from above-"In JavaScript, we can use the built-in procedure Math.abs(): Aren't these the only ways to print in Javascript? • (0 votes) Fredrick Nganga 5 years agoPosted 5 years ago. Direct link to Fredrick Nganga's post “how do I command the para...” how do I command the parameter so as to see the result • (0 votes) Dzaka H. Athif 4 years agoPosted 4 years ago. Direct link to Dzaka H. Athif's post “It depends, you can save ...” It depends, you can save the result first inside a variable, then display the value of the variable using println var absl = Math.abs(-10); or you can just utilize a println procedure and directly write the operation println(Math.abs(-10)); both ways output result (1 vote)Want to join the conversation?
var abs1 = Math.abs(-5);
println(Math.abs(-5));
Can't it be written like this instead?var abs1 = Math.abs(-5);
println(abs1);num
is just the name of a parameter, which indicates that this function takes an input of type number
println("Math.abs(-32):");
println(Math.abs(-32));println
statement, a string literal ("Math.abs(-32):") is being printed. In the second println
statement, the Math.abs() function is actually being called to show the result of the function call.
For ← you type Alt and 27.
If you're on linux you can use AltGr
For ← you type AltGr and y
abs1 ← ABS(-5)
DISPLAY( ABS(-5) )
var abs1 = Math.abs(-5);
println(Math.abs(-5));"
Using the console.log() function
Using the windows.alert() function
Using the innerHTML property
Using the document.write() function
println(absl);
10
See Also
AP® Computer Science PrinciplesAP Computer Science Principles Score Calculator – 2024AP CSP: Questions About Plagiarism and AI – AP CentralAP® Computer Science A Score Calculator | Albert Resources