wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in

Malik

user banner image
profile
Malik @malik

ResumeBlogsQuestions
Sign in

Top Users

profile

Chauhan Jay

@chauhanjay
profile

Hether Padilla

@hetherpadilla
profile

Tejal Jambhale

@tejaljambhale98

Featured Blogs

The Evolution of Operating Systems

Blog banner

MORDERN UNIX SYSTEM

Blog banner

VPN

Blog banner

Burning Questions

what are the steps taken for reduce energy consumption ?

What is interprocess communication

Name the Mumbai's Best College ??

Contact Us

|

About Us

|

Points nomenclature

|

Terms of service

|

Privacy Policy

|

Cookie Policy
profile

Malik

@malikAug 15, 2017

Write a short note on javascript object.?

 JavaScript is an Object Oriented Programming language (OOP). An Object is a special kind of data and acts like real –life objects. An object has properties and methods. A real-life example for object could be a music system. It has properties like, on, off, current volume, etc. The methods could be said as, turn on, turn off, increase volume, etc. Similarly, JavaScript objects do have properties and methods.   PROPERTIES: Properties are the values associated with an Object. Example: stringObject.lengthNOTE: ”. length” is a property which is associated with a string Object. METHODS: Methods could be said as the action which can be performed on an object. Example: stringObject.link(url)NOTE: “.link()” is an action which is used to make a string Object into a link.   KINDS OF JAVASCRIPT OBJECTS There are mainly 6 types of built-in Objects in Javascript. They are, string Object, date Object, Boolean Object, array Object, math Object and RegExp Objects. JAVASCRIPT STRING OBJECT A string Object is used to manipulate a stored piece of Text. Examples: String Object Properties: .length, .prototypeString Object Methods: big(), toUpperCase(), match(); Syntax for creating a String object: var myStr=new String(string); JavaScript Date Object Date Object is used to work with dates and times. Examples: Date Object Properties: .constructor, .prototypeDate Object Methods: Date(), getDate(), getDay() Syntax for creating a Date object: var myDate=new Date(); JavaScript Array Object Array Objects are used to store multiple values in a single variable. An Array can hold more than one value at a time.   Examples Array Object Properties: .length, .prototype,Array Object Methods: .concant(), .join() Syntax for creating an Array object: var myColors=new Array("red”,”blue","green") JavaScript Boolean Object Boolean Object is used to convert a non-boolean value into a Boolean value. ( True /False). Examples Boolean Object Properties: .constructor, .prototypeBoolean Object Methods: .toString(),.valueOf() Syntax for Creating a Boolean Object: Var myBoolean = new Boolean(value); JavaScript Math Object Math Objects are used to perform mathematical tasks. Examples Math Object Properties: .SQRT1_2, .SQRT2Math Object methods: .round(x),.max(x,y) Syntax for Creating a Math Object: All properties and methods of Math can be called by using Math as an object without creating it, because math object is not a constructor. JavaScript RegExp Object The RegExp Obejct is used for “What” to search in the “text”. RegExp is the short for Regular Expression. We can use to search for a pattern inside a text. RegExp is used to strore a pattern.   Examples RegExp Object Properties: .global, .ignoreCaseRegExp Object Methods: .test(), .exec(), .compile(); Syntax for creating a RegExp Object: var txt=new RegExp(pattern,attributes); OR var txt=/pattern/attributes;

1 Discussions
1213 Reads
profile

Malik

@malikAug 15, 2017

Write a short note on javascript.?

JavaScript is a programming language commonly used in web development. It was originally developed by Netscape as a means to add dynamic and interactive elements to websites. While JavaScript is influenced by Java, the syntax is more similar to C and is based on ECMAScript, a scripting language developed by Sun Microsystems. JavaScript is a client-side scripting language, which means the source code is processed by the client's web browser rather than on the web server. This means JavaScript functions can run after a webpage has loaded without communicating with the server. For example, a JavaScript function may check a web form before it is submitted to make sure all the required fields have been filled out. The JavaScript code can produce an error message before any information is actually transmitted to the server. Like server-side scripting languages, such as PHP and ASP, JavaScript code can be inserted anywhere within the HTML of a webpage. However, only the output of server-side code is displayed in the HTML, while JavaScript code remains fully visible in the source of the webpage. It can also be referenced in a separate .JS file, which may also be viewed in a browser. Below is an example of a basic JavaScript function that adds two numbers. The function is called with the parameters 7 and 11. If the code below were included in the HTML of a webpage, it would display the text "18" in an alert box. <script>  function sum(a,b)  {    return a + b;  }  var total = sum(7,11);  alert(total);</script> JavaScript functions can be called within <script>tags or when specific events take place. Examples include onClick, onMouseDown, onMouseUp, onKeyDown, onKeyUp, onFocus, onBlur, onSubmit, and many others. While standard JavaScript is still used for performing basic client-side functions, many web developers now prefer to use JavaScript libraries like jQuery to add more advanced dynamic elements to websites

5 Discussions
711 Reads