Software programing
Открыть в Telegram
This is a channel which gives tutorial on different programming languages, android tips and tricks best apps etc...
Больше1 471
Подписчики
Нет данных24 часа
Нет данных7 дней
Нет данных30 дней
Архив постов
1 471
👽The concat() Method👽
concat() joins two or more strings:
Example👻
var text1 = "software";
var text2 = "programming";
text3 = text1.concat(" ",text2);
The concat() method can be used instead of the plus operator.
These two lines do the same:
Example👻
var text = "Hello" + " " + "World!";
var text = "Hello".concat(" ","World!");
@software_programming1
1 471
👽Converting to Upper and Lower Case
A string is converted to upper case with toUpperCase():
Example👻
var text1 = "programming channel!"; // String
var text2 = text1.toUpperCase(); // text2 is text1 converted to upper
A string is converted to lower case with toLowerCase():
Example👻
var text1 = "Programming Channel!"; // String
var text2 = text1.toLowerCase(); // text2 is text1 converted to lower
@software_programming1
1 471
😏This is the list of special characters that can be added to a text string with the backslash sign:
Code Outputs
\' single quote
\" double quote
\\ backslash
\n new line
\r carriage return
\t tab
\b backspace
\f form feed
@software_programming1
1 471
.
Global JavaScript Variables
A variable declared outside a function, becomes GLOBAL.
A global variable has global scope: All scripts and functions on a web page can access it.
Example
var carName = " vitz";
// code here can use carName
function myFunction() {
// code here can use carName
}
@software_programming1
1 471
JavaScript Scope
In JavaScript, objects and functions are also variables.
In JavaScript, scope is the set of variables, objects, and functions you have access to.
JavaScript has function scope: The scope changes inside functions.
Local JavaScript Variables
Variables declared within a JavaScript function, become LOCAL to the function.
Local variables have local scope: They can only be accessed within the function.
Example
// code here can not use carName
function myFunction() {
var carName = "vitz";
// code here can use carName
}
Since local variables are only recognized inside their functions,
variables with the same name can be used in different functions.
Local variables are created when a function starts, and deleted when the function is competed
1 471
#Object_Methods
An object method is a property that contains a function definition.
Use the following #syntax to access an object method.
1 471
var course = {name: "JS", lessons: 41};
document.write(course.name.length);
//Outputs 2
1 471
JavaScript's built-in length property is used to count the number of characters in a property or string.
1 471
objectName.propertyName
//or
objectName['propertyName']
This example demonstrates how to access the age of our person object.
var person = {
name: "John", age: 31,
favColor: "green", height: 183
};
var x = person.age;
var y = person['age'];
1 471
#Javascript_Objects
JavaScript Objects
JavaScript variables are containers for data values. Objects are variables too, but they can contain many values.
Think of an object as a list of values that are written as name:value pairs, with the names and the values separated by colons.
Example:
1 471
JavaScript Data Types
JavaScript variables can hold many data types: numbers, strings, arrays, objects and more:
varlength=16; // Number
var lastName ="Johnson"; // String
var cars = ["Saab", "Volvo", "BMW"]; // Array
var x = {firstName:"John", lastName:"Doe"}; // Object
JavaScript Has Dynamic Types
JavaScript has dynamic types. This means that the same variable can be used as different types:
Example
var x; // Now x is undefined
var x = 5; // Now x is a Number
var x = "John"; // Now x is a String
@software_programming1
1 471
👻Who wants full w3school offline version?👻
Offline version is a Web pages you can view without being connected to the Internet. W3school is the best website to learn programming like JavaScript SQL html/css PHP Python ...... with Exercises👍👍👍👍
😊@@software_programming1
1 471
I have got some admins to choose from.after this I only need two more askers and I will reveal my co-worker
