Discuss Scratch

Sheep_maker
Scratcher
1000+ posts

NewType, a new and easy programming language

Rendangbike2 wrote:

Can someone tell to me what types mean? I heard that TS is better than JS because it has types.
In many programming languages (including Scratch, though it's not as apparent), values have different types, such as strings or numbers. However, certain operations can only be done on certain types. For example,
value.startsWith('happy')
The above JavaScript code tests whether a given string `value` starts with “happy.” However, it only works if `value` is a string. If `value` is a number, for example, JavaScript will get angry because undefined is not a function or something.

TypeScript allows you to make sure you do not accidentally set `value` to anything but a string. For example, we could make the above snippet into a function in TypeScript:
function startsHappily (value: string): boolean {
  return value.startsWith('happy')
}
`value: string` indicates that `value` must be a string, and `: boolean` means that `startsHappily` returns a boolean (true or false, like the predicates in Scratch), so you can safely use any boolean-specific operations on its return value.

TypeScript can give you more confidence in knowing that your code won't suddenly break due to a little uncaught TypeError. JavaScript is very quirky, which means TypeScript can't protect you from everything, but in most cases it's reassuring enough

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Rendangbike2 wrote:

HPD1155 wrote:

Rendangbike2 wrote:

Rendangbike2 wrote:

Can someone tell to me what types mean? I heard that TS is better than JS because it has types.
Answer this
it means that there are different types of TS like a graphical or a console type
That would be perfect for NT!
con: it is hard let’s stick to JS cuz I know it.
We just have to use webGL, and maybe three.js

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Hey guys, I changed my repl username to my scratch username

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
Techno274721
Scratcher
43 posts

NewType, a new and easy programming language

It doesn't show that u invited me make a post and ping me

this is a signiture make sure to click on my pfp
Techno274721
Scratcher
43 posts

NewType, a new and easy programming language

On repl

this is a signiture make sure to click on my pfp
mybearworld
Scratcher
1000+ posts

NewType, a new and easy programming language

Wish I could help

Signatures are the only place where assets links still work.
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Techno274721 wrote:

On repl
Wut

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Techno274721 wrote:

On repl
Sorry ur invited

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Also please help and work on the projects

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
Rendangbike2
Scratcher
1000+ posts

NewType, a new and easy programming language

HPD1155 wrote:

Rendangbike2 wrote:

HPD1155 wrote:

Rendangbike2 wrote:

Rendangbike2 wrote:

Can someone tell to me what types mean? I heard that TS is better than JS because it has types.
Answer this
it means that there are different types of TS like a graphical or a console type
That would be perfect for NT!
con: it is hard let’s stick to JS cuz I know it.
We just have to use webGL, and maybe three.js
three.js is for 3d things right? and also i'm using python for the compiler or intrepeter because well…..




HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Rendangbike2 wrote:

HPD1155 wrote:

Rendangbike2 wrote:

HPD1155 wrote:

Rendangbike2 wrote:

Rendangbike2 wrote:

Can someone tell to me what types mean? I heard that TS is better than JS because it has types.
Answer this
it means that there are different types of TS like a graphical or a console type
That would be perfect for NT!
con: it is hard let’s stick to JS cuz I know it.
We just have to use webGL, and maybe three.js
three.js is for 3d things right? and also i'm using python for the compiler or intrepeter because well…..
We can add 3D to our language, right?

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
Rendangbike2
Scratcher
1000+ posts

NewType, a new and easy programming language

anyone tell me what does this error mean? IndentationError: unindent does not match any outer level




Rendangbike2
Scratcher
1000+ posts

NewType, a new and easy programming language

HPD1155 wrote:

We can add 3D to our language, right?
No! What do you think i am, a mathematician?
But i suppose we could make a package?




HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Rendangbike2 wrote:

anyone tell me what does this error mean? IndentationError: unindent does not match any outer level
i tried to fix it

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

Rendangbike2 wrote:

HPD1155 wrote:

We can add 3D to our language, right?
No! What do you think i am, a mathematician?
But i suppose we could make a package?
I can use webGL then

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
Chewyblockguy
Scratcher
100+ posts

NewType, a new and easy programming language

new repl.it username: Chewyblockguy




these are gary and bob
<()w()>
(()v())
gary will protect me from the evil kumqauts
and bob will help reform the evil kumqauts


project showcase:
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

ok

Chewyblockguy wrote:

new repl.it username: Chewyblockguy

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
HPD1155
Scratcher
100+ posts

NewType, a new and easy programming language

i gave the website tab icons!

i luv koenigseggs I is a hackr FYI
console.log(“hi); I’m an ethical hacker FYI
Rendangbike2
Scratcher
1000+ posts

NewType, a new and easy programming language

someone just change the settings too look more to the color?




Rendangbike2
Scratcher
1000+ posts

NewType, a new and easy programming language

Rendangbike2 wrote:

anyone tell me what does this error mean? IndentationError: unindent does not match any outer level




Powered by DjangoBB