mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-27 01:33:59 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			572 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			572 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| function shouldBe(actual, expected) {
 | |
|     if (actual !== expected)
 | |
|         throw new Error('bad value: ' + actual);
 | |
| }
 | |
| 
 | |
| {
 | |
|     let array = [42.195, -0.0];
 | |
|     shouldBe(array.lastIndexOf(0), 1);
 | |
|     shouldBe(array.lastIndexOf(-0), 1);
 | |
| }
 | |
| {
 | |
|     let array = [42.195, 0, -0.0];
 | |
|     shouldBe(array.lastIndexOf(0), 2);
 | |
|     shouldBe(array.lastIndexOf(-0), 2);
 | |
| }
 | |
| {
 | |
|     let array = [42, 0];
 | |
|     shouldBe(array.lastIndexOf(0), 1);
 | |
|     shouldBe(array.lastIndexOf(-0), 1);
 | |
| }
 | |
| {
 | |
|     let array = [42, 0, 44];
 | |
|     shouldBe(array.lastIndexOf(0), 1);
 | |
|     shouldBe(array.lastIndexOf(-0), 1);
 | |
| }
 |