60 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| id: cf1111c1c11feddfaeb6bdef
 | |
| title: Divide One Number by Another with JavaScript
 | |
| challengeType: 1
 | |
| videoUrl: ''
 | |
| localeTitle: 用JavaScript划分一个号码
 | |
| ---
 | |
| 
 | |
| ## Description
 | |
| <section id="description">我们也可以将一个数字除以另一个数字。 JavaScript使用<code>/</code>符号进行除法。 <p> <strong>例</strong> </p><blockquote> myVar = 16/2; //分配8 </blockquote></section>
 | |
| 
 | |
| ## Instructions
 | |
| <section id="instructions">更改<code>0</code> ,使<code>quotient</code>等于<code>2</code> 。 </section>
 | |
| 
 | |
| ## Tests
 | |
| <section id='tests'>
 | |
| 
 | |
| ```yml
 | |
| tests:
 | |
|   - text: 使变量<code>quotient</code>等于2。
 | |
|     testString: 'assert(quotient === 2, "Make the variable <code>quotient</code> equal to 2.");'
 | |
|   - text: 使用<code>/</code>运算符
 | |
|     testString: 'assert(/\d+\s*\/\s*\d+/.test(code), "Use the <code>/</code> operator");'
 | |
| 
 | |
| ```
 | |
| 
 | |
| </section>
 | |
| 
 | |
| ## Challenge Seed
 | |
| <section id='challengeSeed'>
 | |
| 
 | |
| <div id='js-seed'>
 | |
| 
 | |
| ```js
 | |
| var quotient = 66 / 0;
 | |
| 
 | |
| ```
 | |
| 
 | |
| </div>
 | |
| 
 | |
| 
 | |
| ### After Test
 | |
| <div id='js-teardown'>
 | |
| 
 | |
| ```js
 | |
| console.info('after the test');
 | |
| ```
 | |
| 
 | |
| </div>
 | |
| 
 | |
| </section>
 | |
| 
 | |
| ## Solution
 | |
| <section id='solution'>
 | |
| 
 | |
| ```js
 | |
| // solution required
 | |
| ```
 | |
| </section>
 |