mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-31 06:01:50 -05:00
60 lines
972 B
Markdown
60 lines
972 B
Markdown
---
|
|
id: cf1111c1c11feddfaeb6bdef
|
|
title: قسّم رقمًا على رَقْم آخر باستخدام JavaScript
|
|
challengeType: 1
|
|
videoUrl: 'https://scrimba.com/c/cqkbdAr'
|
|
forumTopicId: 17566
|
|
dashedName: divide-one-number-by-another-with-javascript
|
|
---
|
|
|
|
# --description--
|
|
|
|
يمكننا أيضًا قسمة رَقْم على آخر.
|
|
|
|
يستخدم JavaScript رمز `/` لعملية القسمة.
|
|
|
|
**مثال**
|
|
|
|
```js
|
|
const myVar = 16 / 2;
|
|
```
|
|
|
|
لدي `myVar` قيمة `8` الآن.
|
|
# --instructions--
|
|
|
|
غيّر `0` بحيث أن `quotient` تساوي `2`.
|
|
|
|
# --hints--
|
|
|
|
يجب أن يساوي المتغير `quotient` قيمة 2.
|
|
|
|
```js
|
|
assert(quotient === 2);
|
|
```
|
|
|
|
يجب عليك استخدام المشغل `/`.
|
|
|
|
```js
|
|
assert(/\d+\s*\/\s*\d+/.test(code));
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --after-user-code--
|
|
|
|
```js
|
|
(function(z){return 'quotient = '+z;})(quotient);
|
|
```
|
|
|
|
## --seed-contents--
|
|
|
|
```js
|
|
const quotient = 66 / 0;
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```js
|
|
const quotient = 66 / 33;
|
|
```
|