parent
7027943873
commit
560b6100f5
@ -0,0 +1,50 @@
|
||||
// Exercise: Level 1
|
||||
const butn = document.getElementsByClassName('mass');
|
||||
let variable = '30 Days Of JavaScript';
|
||||
let fang = 'Facebook, Google, Microsoft, Apple, IBM, Oracle, Amazon';
|
||||
let bec ='You cannot end a sentence with because because because is a conjunction';
|
||||
let str = "";
|
||||
// function myFun(){
|
||||
// alert('open the console please')
|
||||
// }
|
||||
// butn.addEventListener('click', myFun())
|
||||
console.log(variable);
|
||||
console.log(variable.length);
|
||||
console.log(variable.toUpperCase());
|
||||
console.log(variable.toLowerCase());
|
||||
console.log(variable.substring(3));
|
||||
console.log(variable.slice(3,-1));
|
||||
console.log(variable.includes('Script'));
|
||||
console.log(variable.split());
|
||||
console.log(variable.split(' '));
|
||||
console.log(fang.split(', '));
|
||||
console.log(fang.replace("javaScript","python"));
|
||||
console.log(fang.charAt(15));
|
||||
console.log(fang.charCodeAt(11));
|
||||
console.log(fang.indexOf('a'));
|
||||
console.log(fang.lastIndexOf('a'));
|
||||
console.log(bec.indexOf('because'));
|
||||
console.log(bec.lastIndexOf('because'));
|
||||
console.log(bec.search('because'));
|
||||
console.log(variable.trim());
|
||||
console.log(variable.startsWith('3'));
|
||||
console.log(variable.endsWith('t'));
|
||||
console.log(variable.match('a'));
|
||||
console.log(str.concat( '30 Days of', 'JavaScript'));
|
||||
console.log(variable.repeat(2));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script src="./exc-2.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<button class="mass">click me</button>
|
||||
</body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in new issue