Created
August 13, 2011 23:27
-
-
Save wchiquito/1144365 to your computer and use it in GitHub Desktop.
v.1/Ejercicio 1/Reunión #3/Grupo de Estudio JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| .isArray | |
| Implemented in: JavaScript 1.8.5 | |
| ECMAScript Edition: ECMAScript 5th Edition | |
| MDN Docs http://goo.gl/AjneU | |
| */ | |
| /* From MDN Docs http://goo.gl/AjneU */ | |
| if(!Array.isArray) { | |
| Array.isArray = function (arg) { | |
| return Object.prototype.toString.call(arg) == '[object Array]'; | |
| }; | |
| } | |
| function arrayConcatenator(input) { | |
| return Array.isArray(input) ? input.join() : ""; | |
| } | |
| console.group("strings y vectores anidados") | |
| console.assert( | |
| "hola,soy,juan,fernandez,y,no,tengo,dinero" | |
| === | |
| arrayConcatenator(["hola",["soy",["juan","fernandez"]],"y",["no","tengo",["dinero"]]]), | |
| "retorna 'hola,soy,juan,fernandez,y,no,tengo,dinero'"); | |
| console.groupEnd(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment