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
const fs = require('fs'); | |
const path = require('path'); | |
const dirPath = path.join(__dirname,'crud'); | |
const filePath = `${dirPath}/fruit.txt`; | |
// Create File Using File System | |
// fs.writeFileSync(filePath,'This is a simple text file'); |
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
$('#text').keyup(function () { | |
var currVal = $(this).val(); | |
$(this).val(currVal.charAt(0).toUpperCase() + currVal.slice(1).toLowerCase()); | |
}); |
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
<?php | |
namespace App\Http\Controllers; | |
class WebPageSizeCheckerController extends Controller | |
{ | |
public function post(Request $request) | |
{ | |
$url = $request->url; |
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
const person = { | |
fullName: function() { | |
return this.firstName + " " + this.lastName; | |
} | |
} | |
const person1 = { | |
firstName: "Mary", | |
lastName: "Doe" | |
} |
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 readURL(input) { | |
if (input.files && input.files[0]) { | |
var reader = new FileReader(); | |
reader.onload = function(e) { | |
$('#imageResult') | |
.attr('src', e.target.result); | |
}; | |
reader.readAsDataURL(input.files[0]); | |
} | |
} |
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
alert( Math.max(3, 5, 1) ); // 5 | |
let arr = [3, 5, 1]; | |
alert( Math.max(arr) ); | |
let arr = [3, 5, 1]; | |
alert( Math.max(...arr) ); // 5 (spread turns array into a list of arguments) | |
// -------------------------------------------- |
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 sum(...theArgs) { | |
return theArgs.reduce((previous, current) => { | |
return previous + current; | |
}); | |
} | |
console.log(sum(1, 2, 3)); | |
// expected output: 6 | |
console.log(sum(1, 2, 3, 4)); |
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
console.clear() | |
var mList = [1, 2, 3, 4, 5] | |
// var pos; | |
// for(pos = 0; pos < mList.length; pos++) { | |
// console.log('Position => ' + pos + ' Value => ' + mList[pos]) | |
// } | |
// Break Keyword |
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
console.clear() | |
var mFriends = ['Shaw', 'Clara', 'Vab', 'Kun', 'Jacob', 'Dina'] | |
console.log(mFriends) | |
console.log(typeof(mFriends)) | |
console.log(mFriends[2]) | |
console.log(mFriends[0]) | |
console.log(mFriends[4]) |
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
console.clear() | |
// var mCars = { | |
// "p1" : "350 kmph", | |
// "gallardo" : '320 kmph', | |
// "veyron" : '409 kmph', | |
// "agera" : '429 kmph' | |
// } | |
// console.log(mCars) |
NewerOlder