Discuss Scratch
- Discussion Forums
- » Things I'm Making and Creating
- » Scratch-JavaScript community dictionary!!!
- SilverOspreyStudios
-
Scratcher
34 posts
Scratch-JavaScript community dictionary!!!
Recently, I have started learning JavaScript, and I realized how similar it is to scratch. Therefore, I decided to make this dictionary of JavaScript commands and their scratch equivalents. Feel free to use this or to add new commands to the dictionary!
- SilverOspreyStudios
-
Scratcher
34 posts
Scratch-JavaScript community dictionary!!!
DICTIONARY (X or CODE is not a part of the commands)
———————————————————-
if (X) {
CODE
}
=
———————————————————–
prompt(“X”)
=
—————————————————————
if (X) {
CODE
}
else {
CODE
}
=
———————————————————-
var variablename = ‘text’;
=
———————————————————-
confirm(“X”)
=/is close to
———————————————————-
if (X) {
CODE
}
=
if <> then
end
———————————————————–
prompt(“X”)
=
ask [X] and wait
—————————————————————
if (X) {
CODE
}
else {
CODE
}
=
if <> then
else
end
———————————————————-
var variablename = ‘text’;
=
set [variablename v] to [text]
———————————————————-
confirm(“X”)
=/is close to
say [X]
Last edited by SilverOspreyStudios (Aug. 20, 2014 22:36:53)
- Iditaroid
-
Scratcher
500+ posts
Scratch-JavaScript community dictionary!!!
Linking functions from other languages to the blocks in Scratch sounds like a great way to help people expand their programming knowledge! I dont know any JavaScript tho so I cant really help expand this dictionary
- turkey3
-
Scratcher
1000+ posts
Scratch-JavaScript community dictionary!!!
Try putting your code in [code] tags.
- astro-mechanic
-
Scratcher
500+ posts
Scratch-JavaScript community dictionary!!!
For the graphics functions you'll probably need to set up a small Scratch emulating environment (an abstraction layer for pixi.js?)
- supercreeper2005
-
Scratcher
100+ posts
Scratch-JavaScript community dictionary!!!
I know a little. Here:
console.log(X)
console.log(X)
say [X]
- scratchisthebest
-
Scratcher
1000+ posts
Scratch-JavaScript community dictionary!!!
I know a little. Here:What about
console.log(X)say [X]
add [xyz] to [console v]
- SilverOspreyStudios
-
Scratcher
34 posts
Scratch-JavaScript community dictionary!!!
wait, so the console is a list that you can actually draw data from?
- turkey3
-
Scratcher
1000+ posts
Scratch-JavaScript community dictionary!!!
wait, so the console is a list that you can actually draw data from?He console is just a depository of text used mainly for websites that throw error messages so developers can troubleshoot problems.
- SilverOspreyStudios
-
Scratcher
34 posts
Scratch-JavaScript community dictionary!!!
So console.log is more likewait, so the console is a list that you can actually draw data from?He console is just a depository of text used mainly for websites that throw error messages so developers can troubleshoot problems.
say []
than
add [] to [console v]
Last edited by SilverOspreyStudios (Aug. 19, 2014 21:45:33)
- Iditaroid
-
Scratcher
500+ posts
Scratch-JavaScript community dictionary!!!
Is it really all that much like either? I don't know anything about JavaScript but I've worked with Unity and in Unity the console isn't normally visible to the user…So console.log is more likewait, so the console is a list that you can actually draw data from?He console is just a depository of text used mainly for websites that throw error messages so developers can troubleshoot problems.say []
thanadd [] to [console v]
- SilverOspreyStudios
-
Scratcher
34 posts
Scratch-JavaScript community dictionary!!!
it isnt at all like either - I should probably remove it from the dictionary, because it HAS NO SCRATCH EQUIVALENT. it is a feature that cannot be found in scratchIs it really all that much like either? I don't know anything about JavaScript but I've worked with Unity and in Unity the console isn't normally visible to the user…So console.log is more likewait, so the console is a list that you can actually draw data from?He console is just a depository of text used mainly for websites that throw error messages so developers can troubleshoot problems.say []
thanadd [] to [console v]
- turkey3
-
Scratcher
1000+ posts
Scratch-JavaScript community dictionary!!!
Definitely more close to add to list. It's not like a giant speech bubble appears when logging to the console. Hit F12 and open your console to see.Is it really all that much like either? I don't know anything about JavaScript but I've worked with Unity and in Unity the console isn't normally visible to the user…So console.log is more likewait, so the console is a list that you can actually draw data from?He console is just a depository of text used mainly for websites that throw error messages so developers can troubleshoot problems.say []
thanadd [] to [console v]
- jji7skyline
-
Scratcher
1000+ posts
Scratch-JavaScript community dictionary!!!
var variablename = 'text';
equals
set [variablename v] to [text]
Last edited by jji7skyline (Aug. 20, 2014 00:10:18)
- Iditaroid
-
Scratcher
500+ posts
Scratch-JavaScript community dictionary!!!
Isn't there some way to make a little window pop up that says something, or some kind of “print” function? Those would definitely be closer to the “say” block than console.log
- SilverOspreyStudios
-
Scratcher
34 posts
Scratch-JavaScript community dictionary!!!
Isn't there some way to make a little window pop up that says something, or some kind of “print” function? Those would definitely be closer to the “say” block than console.logthere is the confirm(“X”) one I believe… I dont know anything about the print one, although I heard of it before.
- AonymousGuy
-
Scratcher
1000+ posts
Scratch-JavaScript community dictionary!!!
Scratch really isn't at all similar to Java except for the control structures…
Basically, I would say the following things are the same in both languages:
This one is kind of a stretch:
And then some are kind of similar:
Basically, I would say the following things are the same in both languages:
if () { }
if <> then
end
if () { } else { }
if <> then
else
end
function
define
This one is kind of a stretch:
while (!()) { }
repeat until <>
end
And then some are kind of similar:
alert();
say []
prompt();
ask [] and wait
- Harakou
-
Scratcher
1000+ posts
Scratch-JavaScript community dictionary!!!
Isn't there some way to make a little window pop up that says something, or some kind of “print” function? Those would definitely be closer to the “say” block than console.logI believe the function you're thinking of is window.alert(s).
I would generally agree with AonymousGuy that Scratch and JS are rather different, though I can see the value in creating a reference for people trying to wet their feet.

- Discussion Forums
- » Things I'm Making and Creating
-
» Scratch-JavaScript community dictionary!!!