{"action":"opened","issue":{"url":"https://api.github.com/repos/Khan/khan-i18n/issues/79277","labels_url":"https://api.github.com/repos/Khan/khan-i18n/issues/79277/labels{/name}","comments_url":"https://api.github.com/repos/Khan/khan-i18n/issues/79277/comments","events_url":"https://api.github.com/repos/Khan/khan-i18n/issues/79277/events","html_url":"https://github.com/Khan/khan-i18n/issues/79277","id":96106341,"number":79277,"title":"not-translated:In the JavaScript language (and most ...","user":{"login":"KhanBugz","id":924247,"avatar_url":"https://avatars.githubusercontent.com/u/924247?v=3","gravatar_id":"","url":"https://api.github.com/users/KhanBugz","html_url":"https://github.com/KhanBugz","followers_url":"https://api.github.com/users/KhanBugz/followers","following_url":"https://api.github.com/users/KhanBugz/following{/other_user}","gists_url":"https://api.github.com/users/KhanBugz/gists{/gist_id}","starred_url":"https://api.github.com/users/KhanBugz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhanBugz/subscriptions","organizations_url":"https://api.github.com/users/KhanBugz/orgs","repos_url":"https://api.github.com/users/KhanBugz/repos","events_url":"https://api.github.com/users/KhanBugz/events{/privacy}","received_events_url":"https://api.github.com/users/KhanBugz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Khan/khan-i18n/labels/agent_chrome","name":"agent_chrome","color":"ededed"},{"url":"https://api.github.com/repos/Khan/khan-i18n/labels/agent_win7","name":"agent_win7","color":"ededed"},{"url":"https://api.github.com/repos/Khan/khan-i18n/labels/lang_fr","name":"lang_fr","color":"ededed"},{"url":"https://api.github.com/repos/Khan/khan-i18n/labels/type_not-translated","name":"type_not-translated","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-20T16:45:52Z","updated_at":"2015-07-20T16:45:52Z","closed_at":null,"body":"Url: https://fr.khanacademy.org/computing/computer-programming/programming/resizing-with-variables/a/using-math-expressions-in-js\n\nUser Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36\n\nProblem Text: \nIn the JavaScript language (and most programming languages), we can use mathematical operators to calculate numbers and create expressions.\nYou've already seen examples of adding in JS, using the + operator. You can also use - for subtraction, * for multiplication, / for division, and % to take the remainder. Here are examples of those in action:\nvar x = 10;\nvar a = x + 5; // add 5, result is 15\nvar b = x - 5; // subtract 5, result is 5\nvar c = x * 2; // multiply by 2, result is 20\nvar d = x / 4; // divide by 4, result is 2.5\nvar e = x % 4; // divide by 4 & return remainder, result is 2\nWhen you use multiple math operators in a single expression, the computer follows an \"order of operations\" to make sure it computes the result the same way each time. It's the same order of operations that you probably learned in math class, and is commonly remembered as \"PEMDAS\" - parentheses, exponents, multiplication, division, addition, subtraction. You can learn more about order of operations on Khan Academy.\nFor example, in the following code, it would first evaluate the two expressions in parentheses, then it would multiply those results together, and finally, it would add 100 to that result.\n\n  var x = 10;\n  var a = (x + 10) * (x / 2) + 100;\n  \nJust like in math expressions, you only need parentheses if you want your expression to be evaluated differently than it would be according to the order of operations. You can leave them out otherwise.\nNext up, we'll go through an example using more complicated expressions with variables and math operators. If you want, play around with some of these math expressions first, to make sure you have a handle on how the computer evaluates them.\n\nUser Description: \n\n\nNext Steps: \nIf this is a translation issue, fix it. Otherwise verify what is wrong, add a comment in English describing the issue and assign to tzjames."}}