DEV Community

ajidk
ajidk

Posted on

Introduction JavaScript

console.log()

The console.log method is used to log or print messages to the console. It can also be used to print objects and other info.

console.log('Hello World!`); // Hello World!
Enter fullscreen mode Exit fullscreen mode

JavaScript

JavaScript is a programming language that powers the dynamyc behavior on most websites. Alongside HTML and CSS, it is a core technology that makes the web run.

Methods

Methods return information about an object, and are called by appending an instance with a period., the method name, and parentheses.

Libraries

Libraries contain methods that can be called by appending the library name with a period ., the method name, and set of parentheses.

Numbers

Numbers are a primitive data type. They include the set of all integers and floating point numbers.

let amount = 5
let price = 16000;
let total = 80000;
Enter fullscreen mode Exit fullscreen mode

String.length

The .length property of a string returns the number of characters that make up the string.

let message = 'Hello daddy!';
console.log(message.length); // 12
console.log('sugar'.length); // 5
Enter fullscreen mode Exit fullscreen mode

Conclusion

JavaScript arrays have quite a lot of useful methods that can simplify our development efforts.Knowing these methods can save us time and can even boost the performance of our code.

Discussion (0)