SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
Cadenas (strings) en Javascript. Nociones básicas de programación orientada a objetos (POO) necesarias para manejar strings como objetos en Javascript. Programación estructurada y POO. El objeto string en Javascript.
Interfaces de Usuarios, Interacción Humano-Computador y Lenguajes de Programación
Cadenas (strings) en Javascript. Nociones básicas de programación orientada a objetos (POO) necesarias para manejar strings como objetos en Javascript. Programación estructurada y POO. El objeto string en Javascript.
2.
Strings <ul><li>Inicialización </li></ul><ul><li>var UnStr = “Guatemala es el país de la eterna primavera”; </li></ul><ul><li>var OtroStr = new String(“Guatemala es parte de Centroamérica”); </li></ul>
3.
Objetos <ul><li>Representaciones abstractas de elementos funcionales </li></ul><ul><li>Se basan en los objetos del mundo real </li></ul><ul><ul><li>Tienen propiedades </li></ul></ul><ul><ul><li>Saben hacer cosas </li></ul></ul><ul><ul><li>Ejemplo: </li></ul></ul><ul><ul><ul><li>Carro, perro, edificio, escritorio </li></ul></ul></ul>
4.
Clases <ul><li>Son los patrones o machotes de los objetos </li></ul><ul><ul><li>Dos perros pertenecen a la clase perro </li></ul></ul><ul><ul><li>Tienen diferentes atributos </li></ul></ul><ul><li>Son representaciones abstractas de un concepto </li></ul>
5.
Objetos y Clases <ul><li>Las clases definen a los objetos </li></ul><ul><li>Los objetos son instancias de las clases </li></ul><ul><li>Pueden existir subclases </li></ul><ul><ul><li>De la clase perro: </li></ul></ul><ul><ul><ul><li>Perro fino </li></ul></ul></ul><ul><ul><ul><li>Perro entrenado </li></ul></ul></ul><ul><ul><ul><li>Perro callejero </li></ul></ul></ul>
6.
Programación Orientada a Objetos <ul><li>Los objetos </li></ul><ul><ul><li>Encapsulan propiedades y comportamiento </li></ul></ul><ul><ul><ul><li>Atributos </li></ul></ul></ul><ul><ul><ul><li>Métodos </li></ul></ul></ul><ul><li>Ejemplo: </li></ul><ul><ul><li>Un string sabe cómo calcular su longitud </li></ul></ul><ul><ul><li>Un número sabe cómo sacarse raíz cuadrada </li></ul></ul>
7.
Ejemplo OOP <ul><li>var UnStr = “Guatemala es el país de la eterna primavera”; </li></ul><ul><li>var UnNum = 384; </li></ul><ul><li>document.write(UnStr.length + “<BR>”); </li></ul><ul><li>document.write(UnNum.MAX_VALUE + “<BR>”); </li></ul><ul><li>document.write(UnStr.MAX_VALUE + “<BR>”); </li></ul><ul><li>document.write(UnNum.length + “<BR>”); </li></ul>
8.
Ejemplo Progra. Estructurada <ul><li>Dim UnStr </li></ul><ul><li>UnStr = “Guatemala es el país de la eterna primavera” </li></ul><ul><li>Dim UnNum </li></ul><ul><li>UnNum = 384 </li></ul><ul><li>Document.Write Len(UnStr) & “<BR>” </li></ul><ul><li>Document.Write Sqr(UnNum) & “<BR>” </li></ul><ul><li>Document.Write Len(UnNum) & “<BR>” </li></ul><ul><li>Document.Write Sqr(UnStr) & “<BR>” </li></ul>
9.
Objeto String - Atributos <ul><li>Propiedades de un string </li></ul><ul><li>length </li></ul>
10.
Objeto String - Comportamiento <ul><li>Métodos de un string </li></ul><ul><li>Lo que el string puede hacer </li></ul><ul><li>charAt() </li></ul><ul><li>concat() </li></ul><ul><li>indexOf() </li></ul>
11.
Objeto String - Herencia <ul><li>Es posible construír nuevas clases </li></ul><ul><li>A partir de clases anteriores </li></ul><ul><li>Heredando atributos y comportamiento </li></ul><ul><li>Ejemplo: método head </li></ul><ul><ul><li>Devuelve el string en formato <h1>string</h1> </li></ul></ul><ul><li>Se usa propiedad prototype </li></ul>ej073.html
0 likes
Be the first to like this
Views
Total views
652
On SlideShare
0
From Embeds
0
Number of Embeds
14
You have now unlocked unlimited access to 20M+ documents!
Unlimited Reading
Learn faster and smarter from top experts
Unlimited Downloading
Download to take your learnings offline and on the go
You also get free access to Scribd!
Instant access to millions of ebooks, audiobooks, magazines, podcasts and more.
Read and listen offline with any device.
Free access to premium services like Tuneln, Mubi and more.