mirror of
				https://github.com/tc39/test262.git
				synced 2025-11-04 13:44:29 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			565 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			565 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
// Copyright (c) 2014 Hank Yates. All rights reserved.
 | 
						|
// This code is governed by the BSD license found in the LICENSE file.
 | 
						|
 | 
						|
/*---
 | 
						|
esid: sec-array.from
 | 
						|
description: Testing Array.from when passed a String
 | 
						|
author: Hank Yates (hankyates@gmail.com)
 | 
						|
---*/
 | 
						|
 | 
						|
var arrLikeSource = 'Test';
 | 
						|
var result = Array.from(arrLikeSource);
 | 
						|
 | 
						|
assert.sameValue(result.length, 4, 'result.length');
 | 
						|
assert.sameValue(result[0], 'T', 'result[0]');
 | 
						|
assert.sameValue(result[1], 'e', 'result[1]');
 | 
						|
assert.sameValue(result[2], 's', 'result[2]');
 | 
						|
assert.sameValue(result[3], 't', 'result[3]');
 |