View inlineCSStoReact.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inlineCSStoReact($normalcss){ | |
$json = preg_replace_callback( | |
"|(\w+)\-?(\w+)?\s*:\s*([^;]+)\s*;?|", | |
function($matches){ | |
return '"'.$matches[1].ucfirst($matches[2]).'":"'.$matches[3].'",'; | |
}, | |
$normalcss); | |
return "{".rtrim($json,",")."}"; | |
} |
View JS Comment 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//prints Hello World | |
document.write("Hello World"); | |
</script> |
View JSComments2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
//declaring a function to sort numbers | |
function sortNumbers(){ | |
//declare and initialize array of numbers | |
const nums = [3,14,45,12]; | |
//sort the array and display the result | |
document.write(nums.sort()); | |
} | |
sortNumbers(); |
View SingleLineComment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var x = 5; //declare and initalize the variable x | |
var y = x * 4; //multiply the value of x four times | |
</script> |
View MultipleLinesComments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/* initialize and call a function | |
which takes users name in a variable | |
and welcome them on page */ | |
function greetingMessage() { | |
var name = promp("Type your first name."); | |
document.write("Welcome to our page " + name + "!"); | |
} |
View MultipleLinesComments2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var a = 2; | |
var b = 7; | |
var c = 2; | |
document.write("Answer is " + sum()); | |
/* function sum(){ | |
return a+b; | |
} */ | |
View setJS.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setA = new Set(); |
View AddInSet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setA = new Set(); | |
setA.add(“maps”); | |
setA.add("maps").add("filters").add("generators").add("arrow functions"); | |
console.log(setA.size) |
View checkItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setA = new Set(); | |
setA.add(“maps”); | |
setA.add("maps").add("filters").add("generators").add("arrow functions"); | |
setA.has(“promises”); | |
setA.has(“generators”); |
View DeleteItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setA = new Set(); | |
setA.add(“maps”); | |
setA.add("maps").add("filters").add("generators").add("arrow functions"); | |
setA.delete(“filters”); | |
setA.clear(); |
OlderNewer