For example, JS lets you declare functions like “function funcName()”, but our environment only allows the latter. ![]() Conventions: Since JS is a very flexible language and lets you write the same things in multiple ways, we enforce certain conventions to improve the consistency of the code in our community, to make it easier to learn from each other.Best practices: There are some parts of JS syntax that are optional, like ending your statements with semicolons, but it is considered a “best practice” to use semi-colons because it makes your code less likely to be buggy, therefore we enforce that all our code uses semi-colons.Syntax errors: These are when the JS interpreter does not understand your code at all - like if you wrote “var bla = [ } ”, it would get very confused by the mismatched braces and give up trying to turn it into code.If we find something wrong, we throw an error message that describes the problem. We use various tools* to check that your written JavaScript code is valid before we run it. We also include an additional library in our programming environment called ProcessingJS, and that is where we get the drawing & animation functionality from - functions like “rect()”, “ellipse()”, “fill()”, etc.Īdditionally, in our “ HTML/JS: Making web pages interactive ” we include the DOM (Document Object Model) for access methods, modification, events, animation, and in our “ HTML/JS: Making web pages active with jQuery ” we demonstrate how to include the jQuery library and use it for simplifying client-side scripting of HTML and particularly the DOM API.įor security and safety reasons, not all DOM manipulations are allowed on Khan Academy. ![]() In our “Drawing & Animation” curriculum, we teach a programming language called JavaScript, and we teach all of the basics of the JavaScript language: variables, strings, arrays, functions, loops, objects. For markup and stylesheet languages see Which Markup and Stylesheet languages do you teach? Javascript
0 Comments
Leave a Reply. |